$category->getAll(), )); } /** * Проверка передачи переменных в шаблон */ static function actionTest() { self::render('testTemplate.php', array( 'name' => 'Dmitry', 'fname' => 'Krivchikov', 'phone' => '+7-904-610-6141', )); } static function actionPoints() { $points = new Point(); $points = $points->getAll(); $categories = new Category(); $categories = $categories->getAll(); foreach ($points as &$point) { $point['categoryIcon'] = $categories[$point['categoryId']]['icon']; $point['categoryName'] = $categories[$point['categoryId']]['name']; } self::renderPartial('json.php', array( 'data' => $points, )); } /** * Вывод элемента каталога. ID товара берётся из параметра /index/catalog/id/1 */ static function actionCatalog() { $id = (int) App::getParam('id'); if ($id) { $goods = new Goods(); self::render('goods.php', $goods->getByPK($id)); } else { App::error404(); } } }