我在Cake php中的代码看起来像:
public $ceff_instance = array();
public function __construct() {
$this->ceff_instance = $this->wsMethod_GO();
}
protected $filedMethodMappings = $this->$ceff_instance;
$wsMethod_GO
返回数组的位置。但是,它表示我尝试将unexpected T_FUNCTION
数组放入$ceff_instance
的行中有$filedMethodMappings
。这是什么原因?
我无法理解我的生活。
答案 0 :(得分:2)
protected $filedMethodMappings = $this->$ceff_instance;
您无法在方法之外设置使用$this
。
public $ceff_instance = array();
protected $filedMethodMappings = NULL;
public function __construct() {
$this->ceff_instance = $this->wsMethod_GO();
$this->filedMethodMappings = $this->$ceff_instance;
}