想請教
class model {
public $que ;
}
$model = new model();
$model['que'] = 'xxx'; // not working 型別不對
$model->que = 'abc';
但是 yii 的 $model = new $model();
$model['que'] = 'xxx'; // 卻可以 到底怎麼做到的!!
有人可以幫我解惑嗎~~ yii 他是怎麼處理的
The tricker is ArrayAccess.
You can try the following: