예제 #1
0
파일: App.php 프로젝트: jlipinio/MVC-test
 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);
     }
 }
예제 #2
0
파일: Route.php 프로젝트: jlipinio/MVC-test
 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!'));
 }
예제 #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;
 }