Example #1
0
 /**
  * @param View $view
  * @return null
  */
 public function render(View $view)
 {
     if (!is_null($view->getContent())) {
         return $this->template['engine']->renderContent($view->getContent(), $view->getData());
     } elseif (!is_null($view->getTemplate())) {
         return $this->template['engine']->renderTemplate($view->getFullPath(), $view->getData());
     }
     return null;
 }
Example #2
0
 /**
  * @param View $view
  * @return Twig_Loader_Array
  */
 private function loadContent($view)
 {
     $this->template['response'] = 'content';
     return is_array($view->getContent()) ? new Twig_Loader_Array($view->getContent()) : new Twig_Loader_Array(array('content' => $view->getContent()));
 }