development03/carts/listview/cat_id:5
我想接收 cat_id,即 5。我正在使用 $this->params['catId']) 来获取 cat_id。但是,我在下面收到此错误
注意(8):未定义索引:catId [APP/controllers/categories_controller.php, line 384]
控制器
function getCategoryName() {
Debugger::dump($this->params['catId']);
return $this->Category->find('all', array('conditions'=>array('Category.id' => $this->params['catId'] )));
}
看法
<?php
$categories = $this->requestAction("/categories/getCategoryName");
foreach ($categories as $category) {
echo $category['Category']['name'];
} ?>
有任何想法吗?