Where can I set a default value for a property within a model. It is not based on a DB, I need a property to have a value all the time, how can I define this in the model?
Regards
Where can I set a default value for a property within a model. It is not based on a DB, I need a property to have a value all the time, how can I define this in the model?
Regards
If it’s a form model you can do it right away like the following:
class Post extends yii\base\Model
{
public $title = 'test';
}
Thanks samdark. Worked a treat.