Alter Views title programmatically on Drupal 8
function MYMODULE_views_pre_render(ViewExecutable $view) {
if ($view->id() == 'ABC') {
$view->setTitle('MY CUSTOM TITLE');
}
}
function MYMODULE_views_pre_render(ViewExecutable $view) {
if ($view->id() == 'ABC') {
$view->setTitle('MY CUSTOM TITLE');
}
}
Drupal's event system allow to create triggers when an event has been happened like create a custom hook on drupal 7.
The EventSubscriber allow to execute an action on boot as hook_boot or hook_init of drupal 7.
Example.
Example: Add <meta http-equiv="refresh" content="30">
$data = [
'#tag' => 'meta',
'#attributes' => [
Officiel Documentation :
https://api.drupal.org/api/drupal/core!modules!views!views.api.php/function/hook_views_data/8
For that you must add 'database
'
Example: