I couldnt find an answer to this question in Drupal 8.
I've created a simple custom module:
mymodule.info.yml
name: 'mymodule_name'
description: 'basic module for custom implementations'
package: 'custom'
type: module
version: '8.x-1.0'
core: '8.x'
mymodule.module
function mymodule_views_post_execute(\Drupal\views\ViewExecutable $view) {
$view->setTitle('Foo');
}
function mymodule_views_pre_render(\Drupal\views\ViewExecutable $view) {
$view->setTitle('Foo');
}
I tried this hook implementations separately, not at smae time. Both changes the view title, but my custom theme doesnt work.
I also tried in my custom theme the following code:
function mytheme_preprocess_views_view(&$variables) {
$view = $variables['view'];
$view->build_info["title"] = "Foo";
}
It prints "Foo" inside view content, it doesnt override view title.
Any idea?