Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/geteventmanager' of https://github.com/akrabat/zf2
Browse files Browse the repository at this point in the history
… into feature/eventmanager-getter
  • Loading branch information
weierophinney committed Jun 29, 2012
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function setEventManager(EventManagerInterface $events)
*
* @return EventManagerInterface
*/
public function events()
public function getEventManager()
{
if (!$this->events instanceof EventManagerInterface) {
$this->setEventManager(new EventManager());
Expand All @@ -143,7 +143,7 @@ public function events()
*/
public function addRenderingStrategy($callable, $priority = 1)
{
$this->events()->attach(ViewEvent::EVENT_RENDERER, $callable, $priority);
$this->getEventManager()->attach(ViewEvent::EVENT_RENDERER, $callable, $priority);
return $this;
}

Expand All @@ -164,7 +164,7 @@ public function addRenderingStrategy($callable, $priority = 1)
*/
public function addResponseStrategy($callable, $priority = 1)
{
$this->events()->attach(ViewEvent::EVENT_RESPONSE, $callable, $priority);
$this->getEventManager()->attach(ViewEvent::EVENT_RESPONSE, $callable, $priority);
return $this;
}

Expand All @@ -186,7 +186,7 @@ public function render(Model $model)
{
$event = $this->getEvent();
$event->setModel($model);
$events = $this->events();
$events = $this->getEventManager();
$results = $events->trigger(ViewEvent::EVENT_RENDERER, $event, function($result) {
return ($result instanceof Renderer);
});
Expand Down

0 comments on commit 7969827

Please sign in to comment.