상속: extends Twig_Environment
예제 #1
0
파일: Twig.php 프로젝트: lisong/incubator
 /**
  * {@inheritdoc}
  *
  * @param string  $path
  * @param array   $params
  * @param boolean $mustClean
  */
 public function render($path, $params, $mustClean = false)
 {
     $view = $this->_view;
     if (!isset($params['content'])) {
         $params['content'] = $view->getContent();
     }
     if (!isset($params['view'])) {
         $params['view'] = $view;
     }
     $relativePath = str_replace($view->getViewsDir(), '', $path);
     $content = $this->twig->render($relativePath, $params);
     if ($mustClean) {
         $this->_view->setContent($content);
     } else {
         echo $content;
     }
 }