在父控制类中对Smarty变量赋值失败

#1 stalker

  class top extends spController{
    var $tpl_path;
    public function __construct(){
      $this -> tpl_path = '/tpl';
      parent::__construct();
    }
  }


  class main extends top{
    public function index(){
      $this -> display('main_index.html');
    }
  }



2011-04-15 10:31:05

#2 stalker

把 var $tpl_path; 这一行删掉就OK了

2011-04-15 10:35:01

#3 jake

嗯,通过魔术函数调用的。所以不能先定义。

2011-04-15 12:54:43