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; }
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; })); }