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

Commit

Permalink
Fixed interfaces on which view event listeners are attached
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed May 15, 2012
1 parent 5f3f957 commit de245da
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions library/Zend/Mvc/Application.php
Expand Up @@ -9,6 +9,7 @@
use Zend\Http\Header\Cookie;
use Zend\Http\PhpEnvironment\Request as PhpHttpRequest;
use Zend\Http\PhpEnvironment\Response as PhpHttpResponse;
use Zend\Mvc\MvcEvent;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ConfigurationInterface as InstanceConfigurationInterface;
use Zend\Uri\Http as HttpUri;
Expand Down Expand Up @@ -118,11 +119,12 @@ public function bootstrap()
$injectTemplateListener = new View\InjectTemplateListener();
$injectViewModelListener = new View\InjectViewModelListener();

$sharedEvents->attach('Zend\Stdlib\Dispatchable', 'dispatch', array($createViewModelListener, 'createViewModelFromArray'), -80);
$sharedEvents->attach('Zend\Stdlib\Dispatchable', 'dispatch', array($createViewModelListener, 'createViewModelFromNull'), -80);
$sharedEvents->attach('Zend\Stdlib\Dispatchable', 'dispatch', array($injectTemplateListener, 'injectTemplate'), -90);
$sharedEvents->attach('Zend\Stdlib\Dispatchable', 'dispatch', array($injectViewModelListener, 'injectViewModel'), -100);
$events->attach('dispatch.error', array($injectViewModelListener, 'injectViewModel'), -100);
$sharedEvents->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($createViewModelListener, 'createViewModelFromArray'), -80);
$sharedEvents->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($noRouteStrategy, 'prepareNotFoundViewModel'), -90);
$sharedEvents->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($createViewModelListener, 'createViewModelFromNull'), -80);
$sharedEvents->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($injectTemplateListener, 'injectTemplate'), -90);
$sharedEvents->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($injectViewModelListener, 'injectViewModel'), -100);
$events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($injectViewModelListener, 'injectViewModel'), -100);

// Setup MVC Event
$this->event = $event = new MvcEvent();
Expand Down Expand Up @@ -304,4 +306,4 @@ protected function completeRequest(MvcEvent $event)
$events->trigger('finish', $event);
return $event->getResponse();
}
}
}

0 comments on commit de245da

Please sign in to comment.