Help me to understand. When unloading complains of article :: id
This is a controller
public function actionIndex($id=null) { $query = articles::find()->where(['online' => 1]); // get the total number of articles (but do not fetch the article data yet) $count = $query->count(); // create a pagination object with the total count $pagination = new Pagination(['totalCount' => $count, 'pageSize'=>6]); // limit the query using the pagination and retrieve the articles $news = $query->offset($pagination->offset) ->limit($pagination->limit) ->orderBy('id DESC') ->all(); return $this->render('index',[ 'arts'=>$news, 'pagination' => $pagination ]); } This is a Viewers
<php foreach ($arts as $art) { "class =" main-page__news__link js-views-link ">}?>
There is an error in the form of this.
** Unknown Property - yii \ base \ UnknownPropertyException Getting unknown property: common \ models \ Articles :: id
throw new UnknownPropertyException ('Getting unknown property:'. get_class ($ this). '::'. $ name); **