Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / system / tests / themes / test_subtheme / test_subtheme.theme
1 <?php
2
3 /**
4  * @file
5  * Add hooks for tests to use.
6  */
7
8 use Drupal\views\Plugin\views\cache\CachePluginBase;
9 use Drupal\views\ViewExecutable;
10
11 /**
12  * Implements hook_views_pre_render().
13  */
14 function test_subtheme_views_pre_render(ViewExecutable $view) {
15   // We append the function name to the title for test to check for.
16   $view->setTitle($view->getTitle() . ":" . __FUNCTION__);
17 }
18
19 /**
20  * Implements hook_views_post_render().
21  */
22 function test_subtheme_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) {
23   // We append the function name to the title for test to check for.
24   $view->setTitle($view->getTitle() . ":" . __FUNCTION__);
25   if ($view->id() == 'test_page_display') {
26     $output['#rows'][0]['#title'] = t('%total_rows items found.', ['%total_rows' => $view->total_rows]);
27   }
28 }
29
30 /**
31  * Implements hook_preprocess_HOOK() for theme_test_template_test templates.
32  */
33 function test_subtheme_preprocess_theme_test_template_test(&$variables) {
34 }