* Displays default item page. * * @param $id * @return mixed */ public function actionView($id) { $item = $this->findModel($id); $this->registerMeta($item); $related = $item->category->getItems()->where(['<>', 'id', $id])->orderBy(['rand()' => SORT_DESC])->limit(3)->all(); return $this->render('view', [ 'item' => $item, 'related' => $related ]); } /** * Finds the Item model based on its primary key value.
$_GET = [ 'id' => 29430, ];