class IndexAction extends Action {
public function index(){
//方式一
$name='Vigny'; //定义一个变量
$this->name=$name; //把变量导入到模板让name可以接收到这个值
//方式二
$this->name2=$name;
$this->assign('name',$name);
$this->assign('name',$name)->assign('sex','man')->assign('today',$date);
$this->display(); //此处是调用Tpl目录下index文件夹内的index.html模板
}Call to a member function assign() on a non-ob错误位置
FILE: C:\php\htdocs\ThinkPHP\Lib\Core\Think.class.php LINE: 275
TRACE
[15-03-09 03:54:03] C:\php\htdocs\ThinkPHP\Lib\Core\Think.class.php (275) halt(Call to a member function assign() on a non-ob
[15-03-09 03:54:03] C:\php\htdocs\ThinkPHP\Lib\Core\Think.class.php (290) Think::appError(1, Call to a member function assign() on a non-ob
[15-03-09 03:54:03] () Think::fatalError()
错误代码显示是[code][/code]
最佳答案