A
A
alex_belouss2017-01-26 14:18:33
Yii
alex_belouss, 2017-01-26 14:18:33

How to avoid Setting unknown property: common\models\Model::fieldname?

I manually add a field in the table through phpmyadmin, for example the status field,
but when I try to add data to this field $model->status = 1; $model->save();
I get an error How to avoid Setting unknown property: common\models\Article::status
I have to rename the table so that the record asset starts seeing this field. This was not the case before. What can be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2017-01-26
@alex_belouss

After each change to the database structure in the console, flush the cache. And you don't need to rename anything.
Well, or disable caching of the database structure in the application settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question