Example #1
0
 public function send(View $view)
 {
     switch ($this->responseType) {
         case 'html':
             // Бррр, ну и мерзостный же код.
             // Быстрая разработка btw
             header('Content-type', 'text/html; charset=UTF-8');
             $container = new Container($view, $this);
             $container->load($this->pageFile);
             $view->setParam('_pageContent', $container->content);
             $container->load($this->templateFile);
             echo $container->content;
             break;
         case 'json':
             header('Content-type', 'application/json.; charset=UTF-8');
             echo json_encode($view->getParams());
             break;
     }
     return $this;
 }