/** * Output category (categories and services) * * @param int $id */ public function actionIndex($id = 0) { if (!($category = $this->loadModel($id))) { $category = new CatalogCategory(); $category->id = 0; $category->short_title = 'Управление услугами'; } $this->breadcrumbs = CatalogCategory::getParents($category->id); $this->breadcrumbs[] = $category->short_title; $categoryData = new CatalogCategory(); $services = new CatalogService('search'); $services->unsetAttributes(); $services->id_category = $category->id; if (isset($_GET['CatalogService'])) { $services->attributes = $_GET['CatalogService']; } $this->render('index', array('services' => $services, 'categoryData' => $categoryData, 'category' => $category)); }