diff --git a/src/View.php b/src/View.php index 477f5a6f..1733f7ff 100644 --- a/src/View.php +++ b/src/View.php @@ -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()); @@ -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; } @@ -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; } @@ -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); });