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


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
159 views
Teach framework yii2 and stuck on the problem:

Unknown Property – yii\\base\\UnknownPropertyException
Getting unknown property: yii\\db\\ActiveQuery::all

See 16 errors associated with this line:
<?= \\app\\components\\MenuWidget::widget(['tpl' => 'menu'])?>

A screenshot of the errors:
5ae87692d364f846962255.png

So that the commercials, the problem wants to be solved.
But removing this line the template works great:
5ae876a4d2480015042177.png

Details coming to this here: How to fix ParseError syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'?
by | 159 views

2 Answers

0 like 0 dislike
The path app\\components\\MenuWidget replace the line:

$this->data = Category::find()->all;

on:

$this->data = Category::find()->all();
by
0 like 0 dislike
app\\components\\MenuWidget
this is a custom widget for yii does not have the slightest relationship. What's inside him crooked, only the author knows. You though the code would be given.
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
asked Apr 26, 2019 by Bandicoot
0 like 0 dislike
2 answers
asked Apr 28, 2019 by maksim92
110,608 questions
257,186 answers
0 comments
36,596 users