public function render($template, $vdata=array())
	{
	    if (!$this->templateExists($template)) {
	        return 'Template is not exists:' . $this->getTemplateRelativePath($template);
	    }
	    
		// view vars
	    if ($this->getData()->keys()) {
	        extract($this->getData()->all(), EXTR_SKIP);
		}
		if ($vdata instanceof Collection) {
		    extract($vdata->all(), EXTR_SKIP);
		} elseif ($vdata) {
		    extract($vdata, EXTR_SKIP);
		}
		unset($vdata);
		
		// layout
		$_layout = static::getLayoutFromTemplate($template);
		if (is_null($_layout)) {
		    if ($this->getLayout() && $template !== $this->getLayout() && ($this->options['nolayout'] || !in_array($template, $this->options['nolayout']))) {
		        // layout template
		        // 对于 phtml 模板: {include $__content_template__}
		        // 对于 php 模板:   <?php include $this->include($__content_template__); ?\>
		        $__content_template__ = $template;
		        $template = $this->getLayout();
		    }
		} elseif ($_layout) {
		    $__content_template__ = $template;
		    $template = $_layout;
		}
		
		ob_start();
		require $this->getCompiledFile($template);
		
		$content = ob_get_contents();
		ob_end_clean();
		
		return $content;
	}
public function render($template, $vdata=array())
	{
	    if (!$this->templateExists($template)) {
	        return 'Template is not exists:' . $this->getTemplateRelativePath($template);
	    }
	    
		// view vars
	    if ($this->getData()->keys()) {
	        extract($this->getData()->all(), EXTR_SKIP);
		}
		if ($vdata instanceof Collection) {
		    extract($vdata->all(), EXTR_SKIP);
		} elseif ($vdata) {
		    extract($vdata, EXTR_SKIP);
		}
		unset($vdata);
		
		// layout
		$_layout = static::getLayoutFromTemplate($template);
		if (is_null($_layout)) {
		    if ($this->getLayout() && $template !== $this->getLayout() && ($this->options['nolayout'] || !in_array($template, $this->options['nolayout']))) {
		        // layout template
		        // 对于 phtml 模板: {include $__content_template__}
		        // 对于 php 模板:   <?php include $this->include($__content_template__); ?\>
		        $__content_template__ = $template;
		        $template = $this->getLayout();
		    }
		} elseif ($_layout) {
		    $__content_template__ = $template;
		    $template = $_layout;
		}
		
		ob_start();
		require $this->getCompiledFile($template);
		
		$content = ob_get_contents();
		ob_end_clean();
		
		return $content;
	}
public function render ( $ template , $ vdata = array ( ) ) { if ( ! $ this -> templateExists ( $ template ) ) { return 'Template is not exists:' . $ this -> getTemplateRelativePath ( $ template ) ; } // view vars if ( $ this -> getData ( ) -> keys ( ) ) { extract ( $ this -> getData ( ) -> all ( ) , EXTR_SKIP ) ; } if ( $ vdata instanceof Collection ) { extract ( $ vdata -> all ( ) , EXTR_SKIP ) ; } elseif ( $ vdata ) { extract ( $ vdata , EXTR_SKIP ) ; } unset ( $ vdata ) ; // layout $ _layout = static :: getLayoutFromTemplate ( $ template ) ; if ( is_null ( $ _layout ) ) { if ( $ this -> getLayout ( ) && $ template !== $ this -> getLayout ( ) && ( $ this -> options [ 'nolayout' ] || ! in_array ( $ template , $ this -> options [ 'nolayout' ] ) ) ) { // layout template // 对于 phtml 模板: {include $__content_template__} // 对于 php 模板:   <?php include $this->include($__content_template__); ?\> $ __content_template__ = $ template ; $ template = $ this -> getLayout ( ) ; } } elseif ( $ _layout ) { $ __content_template__ = $ template ; $ template = $ _layout ; } ob_start ( ) ; require $ this -> getCompiledFile ( $ template ) ; $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; return $ content ; }
render template file to string

@param string $template
@param array|Collection  $vdata
@return string
render template file to string