Hello. I have this doubt:
in my model, I have this attribute:
protected $date_end;
Now, in the form file, I have this code:
<?php echo $form->labelEx($model,'date_end'); ?>
<?php echo $form->textField($model,'date_end'); ?>
So, when click “Save” button, I need to access to the ‘date_end’ model attribute.
I have this, but $this->date_end prints blank and doesn’t work:
protected function beforeSave()
{
if(parent::beforeSave())
{
Yii::trace("Date:".$this->date_end,"file");
return true;
}
else
return false;
}
What’s the correct manner to access to my model attribute just when saving?