Hi guys,
Whenever I add a virtual attribute field to my model like so:
class User extends CActiveRecord
{
public $title;
I can’t seem to bind the data in my update action in the controller:
public function actionUpdate($id)
{
$model = $this->loadModel($id);
if(isset($_POST['User']))
{
$model->attributes = $_POST['User'];
if($model->save())
$this->redirect(array('view','id' => $model->userId));
}
$this->render('update',array(
'model'=>$model,
));
}
Then when I go look at what’s in $model->attributes i can’t find my $model->title anywhere.
It’s in the $_POST[‘User’], but for some reason it won’t bind to my model.
Anyone got any thoughts on how to troubleshoot this?
Thx in advance!