Created
June 28, 2017 06:53
-
-
Save YasinPatel/c3de7bd4f596c60e1fc07d7c4af8e880 to your computer and use it in GitHub Desktop.
Load default values in yii2 in model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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