function workflow_url_get_title in Workflow 8
Helper function to determine the title of the page.
Used in file workflow.routing.yml.
Return value
\Drupal\Core\StringTranslation\TranslatableMarkup the page title.
2 string references to 'workflow_url_get_title'
- workflow.routing.yml in ./
workflow.routing.yml - workflow.routing.yml
- workflow_access.routing.yml in modules/
workflow_access/ workflow_access.routing.yml - modules/workflow_access/workflow_access.routing.yml
File
- ./
workflow.module, line 766 - Support workflows made up of arbitrary states.
Code
function workflow_url_get_title() {
$label = '';
// Get the Workflow from the page.
/** @var \Drupal\workflow\Entity\Workflow $workflow */
/** @noinspection PhpAssignmentInConditionInspection */
if ($workflow = workflow_url_get_workflow()) {
$label = $workflow
->label();
}
$title = t('Edit @entity %label', [
'@entity' => 'Workflow',
'%label' => $label,
]);
return $title;
}