Example #1
0
 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);
     }
 }
Example #2
0
 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!'));
 }
Example #3
0
 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;
 }