コード例 #1
0
 protected function dispatchRequest()
 {
     $jsonModel = new JsonModel();
     try {
         $jsonModel = $this->controller->dispatch($this->getRequest());
     } catch (\Exception $e) {
         echo "\n" . __FILE__ . ':' . __LINE__ . ' Message: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine();
     }
     return $jsonModel;
 }
コード例 #2
0
ファイル: Module.php プロジェクト: Lebe1ge/JobeetForZF2
 public function getControllerConfig()
 {
     return array('factories' => array('Admin\\Controller\\Category' => function (ControllerManager $cm) {
         $sm = $cm->getServiceLocator();
         $config = $sm->get('Config');
         $config = isset($config['jobeet']) ? $config['jobeet'] : array();
         $category = $sm->get('Jobeet\\Model\\CategoryTable');
         $job = $sm->get('Jobeet\\Model\\JobTable');
         $controller = new CategoryController($category, $job);
         $controller->setConfig($config);
         return $controller;
     }, 'Admin\\Controller\\Job' => function (ControllerManager $cm) {
         $sm = $cm->getServiceLocator();
         $config = $sm->get('Config');
         $config = isset($config['jobeet']) ? $config['jobeet'] : array();
         $category = $sm->get('Jobeet\\Model\\CategoryTable');
         $job = $sm->get('Jobeet\\Model\\JobTable');
         $controller = new JobController($category, $job);
         $controller->setConfig($config);
         return $controller;
     }));
 }