private $data = array();
Class API Module{
public function __set($var_name, $var_value){
$this->data[$var_name]=$var_value;
}
public function __get($var_name){
return $this->data[$var_name];
}
public function show(){
return $this->api_title;
}
}
Calling
$c = new APIModule();
$c->api_title=$this->input->post_get('api_title',TRUE); //Calling __get method automatically
echo $c->show();
Class API Module{
public function __set($var_name, $var_value){
$this->data[$var_name]=$var_value;
}
public function __get($var_name){
return $this->data[$var_name];
}
public function show(){
return $this->api_title;
}
}
Calling
$c = new APIModule();
$c->api_title=$this->input->post_get('api_title',TRUE); //Calling __get method automatically
echo $c->show();
0 comments:
Post a Comment