Elgg  Version 4.3
AddTitleHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Page;
4 
11 
19  public function __invoke(\Elgg\Hook $hook) {
20  $head_params = $hook->getValue();
21 
22  $title = $hook->getParam('title');
23  if (empty($title)) {
24  $head_params['title'] = elgg_get_site_entity()->getDisplayName();
25  } else {
26  $head_params['title'] = $title . ' : ' . elgg_get_site_entity()->getDisplayName();
27  }
28 
29  return $head_params;
30  }
31 }
Add title to page head.
$title
Definition: generic.php:50
__invoke(\Elgg\Hook $hook)
Add title to HTML head.
Models an event passed to hook handlers.
Definition: Hook.php:11
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:99