Skip to content

Instantly share code, notes, and snippets.

@YasinPatel
Created June 28, 2017 06:53
Show Gist options
  • Save YasinPatel/c3de7bd4f596c60e1fc07d7c4af8e880 to your computer and use it in GitHub Desktop.
Save YasinPatel/c3de7bd4f596c60e1fc07d7c4af8e880 to your computer and use it in GitHub Desktop.
Load default values in yii2 in model
1. by model :
[['attribute', 'second_attribute'], 'default', 'value' => 'something_here'],
2. load attributes in model
$model = new Post();
$model->loadDefaultValues();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment