选择语言 :

 Core_View::render

执行视图输出

string Core_View::render( [ boolean $print = bool true ] )
throws
Exception

参数列表

参数 类型 描述 默认值
$print boolean 是否直接echo出,true: 是,false: 将执行完结果的HTML返回 bool true
返回值
  • string
File: ./core/classes/view.class.php
public function render($print = true)
{

    if (empty($this->_file))
    {
        throw new Exception(__('You must set the file to use within your view before rendering'));
    }

    // Combine local and global data and capture the output
    $output = View::capture($this->_file, $this->_data);

    if ($print)
    {
        echo $output;
    }
    else
    {
        return $output;
    }
}