Elgg  Version 6.1
AddTitleHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Page;
4 
11 
19  public function __invoke(\Elgg\Event $event) {
20  $head_params = $event->getValue();
21 
22  $title = $event->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
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:101
__invoke(\Elgg\Event $event)
Add title to HTML head.
Models an event passed to event handlers.
Definition: Event.php:11