function dispatch($uri) { $this->request->setUri($uri); $event = new \Zend\Mvc\MvcEvent(); $event->setRouter($this->router); $event->setRequest($this->request); $this->events->trigger('route', $event); $this->routeMatch = $event->getRouteMatch(); }
/** * Init layout view model * @return \BoilerAppMessenger\Media\Mail\MailMessageRenderer */ public function initLayout() { //Create layout template $oEvent = new \Zend\Mvc\MvcEvent(\Zend\Mvc\MvcEvent::EVENT_RENDER); $oEvent->setViewModel(new \Zend\View\Model\ViewModel()); if ($this->hasTemplatingService()) { $this->getTemplatingService()->buildLayoutTemplate($oEvent->setRequest(new \Zend\Http\Request())); } $this->plugin('view_model')->setRoot($oEvent->getViewModel()); return $this; }
public function getServiceConfig() { return array('factories' => array('MaglLegacyApplicationOptions' => function ($sl) { $config = $sl->get('Config'); $options = $config['magl_legacy_application']; return new Options\LegacyControllerOptions($options); }, 'MaglControllerService' => function (ServiceManager $sl) { $eventManager = $sl->get('Application')->getEventManager(); $event = new \Zend\Mvc\MvcEvent(); $event->setApplication($sl->get('Application')); $event->setTarget($sl->get('Application')); $event->setRequest($sl->get('Request')); $event->setRouter($sl->get('Router')); $event->setRouteMatch(new RouteMatch(array())); return new Service\ControllerService($eventManager, $event); })); }