function hook_page_alter(&$page) {
$page['page_bottom']['devel']= array(
'#type' => 'markup',
'#markup' => '<div style="clear:both;">' . theme('TEST') . '</div>',
); // add test template on every page at bottom position.
}
在Drupal 8中没有
hook_page_alter()
。
我应该用Drupal 8使用哪个钩??
您可以在Drupal 8中使用
hook_preprocess_page(&$variables)
来更改页面内容。
示例: