Please help, how i can add dynamic varible in Yii CFormModel?
private function magic($name, $value) {
$this->$name = $value;
}
or
$form = new FormGenerate($attributes);
$form->temp = '1';
Show me Exception "Undetermined property" =(
Please help, how i can add dynamic varible in Yii CFormModel?
private function magic($name, $value) {
$this->$name = $value;
}
or
$form = new FormGenerate($attributes);
$form->temp = '1';
Show me Exception "Undetermined property" =(
On
I create varible $_params;
And
public function __get($name)
{
if (isset($this->_params[$name])) {
return $this->_params[$name];
}
return parent::__get($name);
}
public function __set($name, $value)
{
if (isset($this->_params[$name])) {
$this->_params[$name] = $value;
} else {
parent::__set($name, $value);
}
}
It's work =)
In your class try something like this
try changing your
to
to see what happens.