model 只可以用__set 無法用__get嗎
本帖最后由 arnold0613 于 2013-12-17 10:08 编辑class User extends CI_Model {
private $id,$name,$account,$password,$level;
/*
function __get($name){
return $this->$name;
}
*/
function __set($name,$value){
$this->$name=$value;
}
}
只要把__get註解拿掉就會出錯 有什麼方法可以替代嗎
不然就要寫一推類似來取
function getId(){
return $this->id;
} CI_Model已经有__get实现啦
- -你这里就算取消注释也不会报错啊。。
页:
[1]