Skip to content
Browse files

Setting the headTitle for both People actions

  • Loading branch information...
1 parent dae8306 commit dea75bb4114426d908902001f424631996aeb3cc @SocalNick SocalNick committed Feb 29, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −0 config/module.config.php
  2. +4 −1 src/IgnGravatar/Controller/PeopleController.php
View
1 config/module.config.php
@@ -65,6 +65,7 @@
'defaults' => array(
'controller' => 'IgnGravatar\Controller\PeopleController',
'action' => 'index',
+ 'headTitle' => 'People',
),
),
),
View
5 src/IgnGravatar/Controller/PeopleController.php
@@ -52,14 +52,17 @@ public function preDispatch(MvcEvent $e)
public function indexAction()
{
+ $this->getLocator()->get('Zend\View\Renderer\PhpRenderer')->headTitle($this->getEvent()->getRouteMatch()->getParam('headTitle'));
return array('profiles' => $this->profilesByEmailAddress);
}
public function personAction()
{
$username = $this->getEvent()->getRouteMatch()->getParam('username');
if (isset($this->profilesByUsername[$username])) {
- return array('profile' => $this->profilesByUsername[$username]);
+ $profile = $this->profilesByUsername[$username];
+ $this->getLocator()->get('Zend\View\Renderer\PhpRenderer')->headTitle($profile->getDisplayName());
+ return array('profile' => $profile);
}
throw new \Exception('Profile not found');
}

0 comments on commit dea75bb

Please sign in to comment.
Something went wrong with that request. Please try again.