<ASK> yii2. Required Fields no longer contain required value?

hi all…

in yii2, in _form.

usually like yii1 if we have database required value like "publishedStatus",

if we set that field with integer, and default value is 3,

then yii1 is smart, in _form will produce publishedStatus value with 3.

now in yii2 no longer get data from database.

how about this issue sir?

is it new policy?

thank you for this great framework :)

http://www.yiiframework.com/doc-2.0/guide-db-active-record.html#loading-default-values

thank you verymuch sir.

so this feature hidden by default.

it is like a diamond in the sand.

thank you for this great framework :)


$customer = new Customer();

$customer->loadDefaultValues();

// ... render HTML form for $customer ...