/** * Action method for auto completion sections by the given parent category. * @param integer $id of the category to be used to auto complete sections. * @return string|Response action method execution result. */ public function actionSections($id) { $sections = Section::findAll(['category_id' => $id]); $items = array_merge(['(choose section)'], ArrayHelper::map($sections, 'id', 'title')); return Html::renderSelectOptions(null, $items); }