public function action_run( )
{
$this->getMeta( "ch_weibo_index" );
$var_array = array(
"page_title" => $this->metawrap['title'],
"page_description" => $this->metawrap['description'],
"page_keyword" => $this->metawrap['keyword']
);
$this->_tplfile = $this->getTPLFile( "weibo_index" );
TPL::assign( $var_array );
TPL::display( $this->_tplfile );
}
这个涵数后面三句$this->_tplfile = $this->getTPLFile( "weibo_index" );
TPL::assign( $var_array );
TPL::display( $this->_tplfile );是什么意思?谁能帮忙解释下吗?
{
$this->getMeta( "ch_weibo_index" );
$var_array = array(
"page_title" => $this->metawrap['title'],
"page_description" => $this->metawrap['description'],
"page_keyword" => $this->metawrap['keyword']
);
$this->_tplfile = $this->getTPLFile( "weibo_index" );
TPL::assign( $var_array );
TPL::display( $this->_tplfile );
}
这个涵数后面三句$this->_tplfile = $this->getTPLFile( "weibo_index" );
TPL::assign( $var_array );
TPL::display( $this->_tplfile );是什么意思?谁能帮忙解释下吗?
_tplfile是当前类的一个属性名 getTPLFile是当前类或者其父类的一个方法
TPL::assign( $var_array );和smarty差不多的就是一个将值传给页面
TPL::display( $this->_tplfile );要显示的页面如果不清楚可以去看看TPL这个类 assign和display都在里面 虽然我没用过你这个框架
这个从函数名可知是获取模板文件的,echo $this->_tplfile; 不就知道了。
TPL::assign( $var_array ); //这个类似smarty的assign,为模板分配变量
TPL::display( $this->_tplfile ); //这个类似于smarty的display,显示模板