FrontendEnvironmentTitleController.php in Build Hooks 8.2
File
src/Controller/FrontendEnvironmentTitleController.php
View source
<?php
namespace Drupal\build_hooks\Controller;
use Drupal\Core\Controller\ControllerBase;
class FrontendEnvironmentTitleController extends ControllerBase {
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'),
]);
}
}