Answer the question
In order to leave comments, you need to log in
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:
Something like that, the problem doesn't want to be solved.
But by removing this line, the template works fine:
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
In the app\components\MenuWidget path, replace the line:
with:$this->data = Category::find()->all();
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 questionAsk a Question
731 491 924 answers to any question