public function webview(){
$note = M('table')->getField('txt');
$this->assign('note',$note);
$this->display();
}
执行这个方法的时候报错
Call to a member function assign() on a non-object
原因:本控制器的构造函数覆盖了父类的构造函数
解决方法:在现在控制器的构造方法中调用父类的构造函数
public function __construct(){
parent::__construct();
}
It’s ok !