A
A
AlTa0162018-05-01 17:16:43
Yii
AlTa016, 2018-05-01 17:16:43

How to resolve the Unknown Property - yii\base\UnknownPropertyException Getting unknown property: yii\db\ActiveQuery::all error?

I'm learning yii2 framework and stuck on the problem:
Unknown Property - yii\base\UnknownPropertyException
Getting unknown property: yii\db\ActiveQuery::all I see
16 errors related to this line:
<?= \app\components\MenuWidget::widget([ 'tpl' => 'menu'])?>
Screenshot of errors:
5ae87692d364f846962255.png
Something like that, the problem doesn't want to be solved.
But by removing this line, the template works fine:
5ae876a4d2480015042177.png
Details of coming to this here: How to fix ParseError syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2018-05-01
@AlTa016

In the app\components\MenuWidget path, replace the line:
with:
$this->data = Category::find()->all();

M
Maxim Timofeev, 2018-05-01
@webinar

app\components\MenuWidget
this is a custom widget for yii that has nothing to do with it. What is crooked inside it - only the author knows. You could at least give me a code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question