public function FrontendEnvironmentTitleController::frontendDeploymentTitle in Build Hooks 3.x
Same name and namespace in other branches
- 8.2 src/Controller/FrontendEnvironmentTitleController.php \Drupal\build_hooks\Controller\FrontendEnvironmentTitleController::frontendDeploymentTitle()
Get the title of frontend environment from current route.
Return value
string The name of the frontend environment.
1 string reference to 'FrontendEnvironmentTitleController::frontendDeploymentTitle'
File
- src/
Controller/ FrontendEnvironmentTitleController.php, line 18
Class
- FrontendEnvironmentTitleController
- Controller for route titles.
Namespace
Drupal\build_hooks\ControllerCode
public function frontendDeploymentTitle() {
$path = \Drupal::request()
->getpathInfo();
$arg = explode('/', $path);
$config = \Drupal::config('build_hooks.frontend_environment.' . $arg[4]);
return $this
->t('@env environment deployment', [
'@env' => $config
->get('label'),
]);
}