public function run() { try { $params = $this->_request->params(); $controller = $this->controller($params['controller'], $params['config']); $controller->action($params['action'])->send(); } catch (MiException $e) { MiException::sendHandler($e); } }
static function run() { $request = new Request(); $params = null; if ($app = self::findByUri($request->uri(), $params)) { $request->params($params)->pattern($app->pattern()); $app->request($request)->run(); return; } MiException::sendHandler(new MiException('Not found app!')); }
public function loadMessage() { $repository = $this->_em->getRepository(__NAMESPACE__ . '\\Entity\\Message'); $query = $repository->createQueryBuilder('p')->orderBy('p.date', 'DESC')->getQuery(); try { $messages = $query->getResult(); } catch (TableNotFoundException $e) { return false; } catch (\Exception $e) { MiException::sendHandler($e); } $this->_data = array("messages" => $messages); return $this; }