the function below demo how to assign var to php template view file
下面的函数显示怎么传递变量到模板文件里
public function renderInternal($_viewFile_,$_data_=null,$_return_=false)
{
// we use special variable names here to avoid conflict when extracting data
if(is_array($_data_))
extract($_data_,EXTR_PREFIX_SAME,'data');
else
$data=$_data_;
if($_return_)
{
ob_start();
ob_implicit_flush(false);
require($_viewFile_);
return ob_get_clean();
}
else
require($_viewFile_);
}
这篇文章发布于 2011年11月30日,星期三,22:52,归类于 php perl ruby, web。 您可以跟踪这篇文章的评论通过 RSS 2.0 feed。
您可以留下评论,或者从您的站点trackback。
Aloha!sfju! http://bqccsw.com jpxrx hmziw