예제 #1
0
 public function render($template)
 {
     $response = parent::render('header.php');
     $response .= parent::render($template);
     $response .= parent::render('footer.php');
     return $response;
 }
예제 #2
0
 /**
  * Render template
  * @var string Template to be rendered (optional)
  */
 public function render($template = '')
 {
     $template = is_string($template) ? $template . '.php' : null;
     if ($template) {
         $this->appendData(array('global' => $this->global));
         $content = parent::render($template);
     } else {
         $content = '';
     }
     // make sure buffers flushed
     ob_end_flush();
     ob_flush();
     ob_start();
     extract(array('content' => $content, 'global' => $this->global));
     if ($this->layout) {
         $layoutPath = $this->getTemplatesDirectory() . '/' . ltrim($this->layout, '/');
         if (!file_exists($layoutPath)) {
             throw new RuntimeException('View cannot render layout `' . $layoutPath);
         }
         require $layoutPath;
     } else {
         echo $content;
     }
     return ob_get_clean();
     //echo "render";
 }
예제 #3
0
 public function render($template)
 {
     $this->setData('childView', $template);
     $template = $this->masterTemplate;
     return parent::render($template);
 }