Posts
Katik Dependent Dropdown
- Get link
- X
- Other Apps
Category Model public static function getCategories() { return Self::find()->select(['name', 'id'])->indexBy('id')->column(); } Sub Category Model public static function getSubCatList($categoryID, $ isAjax = false) { $subCategory = self::find() ->where(['category_id' => $categoryID]); if ($isAjax == true) { return $subCategory->select(['id', 'name'])->asArray()->all(); } else { return $subCategory->select(['name'])->indexBy('id')->column(); } } Product model public static function getProductList($categoryID, $subCatID, $ isAjax = false) { $product = self::find() ->where(['category_id' => $categoryID]) ...