public function actionDiaryCategory($categoryId) { if (!$this->isAjax()) { throw new BadRequestHttpException(); } $model = new Diary(); $model->productCategoryId = $categoryId; return $this->renderPartial('@app/views/diary/_category-elements-dropdown-list', ['model' => $model, 'form' => ActiveForm::begin(), 'param' => 'productsList', 'items' => $model->getProductItems()]); }