Exemple #1
0
 /**
  * Render view
  *
  * @param Presenter $presenter
  * @param Response $response
  */
 protected function prepareView(Presenter $presenter, Response $response)
 {
     $eventManager = $this->container->getEventManager();
     $event = new ExecutePresenterEvent($this->request, $response);
     $eventManager->fire('executePresenter', $event);
     $presenter->render($this->request, $response);
 }
Exemple #2
0
 /**
  *
  * @param Config $eventNode
  * @param DependencyInjection $dependencyInjection
  */
 private function eventManagerBind(Config $eventNode, DependencyInjection $dependencyInjection)
 {
     $eventManager = $this->container->getEventManager();
     foreach ($eventNode->getNodes('bind') as $bindNode) {
         /**
          * @var Config $bindNode
          */
         $eventManager->register($bindNode->getAttribute('name'), $dependencyInjection->get($eventNode->getAttribute('class')), $bindNode->getAttribute('method'));
     }
 }
 public function down(Container $container)
 {
     $data = file_get_contents($container->getEnvironment()->getRootPath() . '/count.txt');
     file_put_contents($container->getEnvironment()->getRootPath() . '/count.txt', substr($data, 0, -2));
 }
 /**
  * @param Container $container
  * @return DoctrineService
  */
 public function getDoctrine(Container $container)
 {
     return $container->getService('doctrine');
 }