How to set default values for backend form fields
9
In your controller, use the formExtendModel
method to set the model's properites:
public function formExtendModel($model)
{
if ($this->formGetContext() === 'create') {
$model->your_field = 'Your default value';
}
}
There are no comments yet
Be the first one to comment