Example #1
0
 protected function Render($data = [])
 {
     $retorno = new Retorno($this->app, $this->config);
     if ($this->app['api']) {
         $retorno->jsonRPC($data);
     }
     $options = $this->app['options'];
     if (array_key_exists('notview', $options) && $options['notview']) {
         exit;
     }
     $retorno->twig($data);
 }
Example #2
0
 public function Run()
 {
     try {
         $router = filter_input(INPUT_GET, 'router');
         $this->checkRota($router);
         $ann = new Annotation($this->app, $this->config);
         $ann->validation($this->app['Contr'], $this->action, $this->app['options']);
         $action = $this->action;
         $this->controller->{$action}();
     } catch (\Exception $e) {
         $retorno = new Retorno($this->app, $this->config);
         $code = $e->getCode();
         http_response_code($code);
         if ($this->app->offsetExists('api') && $this->app['api']) {
             $retorno->jsonRPC($e, $code);
         }
         $retorno->twigException($e);
     }
 }