Example #1
0
 public function Render($controllerName = '', $actionName = '')
 {
     if ($this->viewEnabled) {
         if (!$controllerName) {
             $controllerName = $this->request->params['controller'];
         }
         if (!$actionName) {
             $actionName = $this->request->params['action'];
         }
         // complete paths
         $controllerPath = str_replace('_', DIRECTORY_SEPARATOR, $controllerName);
         $viewScriptPath = implode(DIRECTORY_SEPARATOR, array($controllerPath, $actionName));
         // render content string
         $actionResult = $this->view->RenderScript($viewScriptPath);
         // create parent layout view, set up and render to outputResult
         $layout = new MvcCore_View($this);
         $layout->SetUp($this->view);
         $outputResult = $layout->RenderLayout($this->layout, $actionResult);
         unset($layout, $this->view);
         // minify if class exists
         if ($this->minifyHtml && class_exists('Minify_HTML')) {
             $outputResult = Minify_HTML::minify($outputResult);
         }
         // send response and exit
         $this->HtmlResponse($outputResult);
     }
 }