public function bycategoryAction() { $id = $this->_getParam('cat_id', 0); if ($id > 0) { //show dishes from this category id $fooditems = new Model_DbTable_FoodItems(); $itemsRowset = $fooditems->find($id); $thisCategory = $itemsRowset->current(); $categoryID = $thisCategory['id']; $cuisineID = $thisCategory['cuisine_id']; $cuisines = new Model_DbTable_Cuisines(); $itemsRowset = $cuisines->find($cuisineID); $thisCuisine = $itemsRowset->current(); $categoryName = $thisCategory['name']; $cuisineName = $thisCuisine['name']; $this->view->catname = $categoryName; $this->view->catID = $categoryID; $this->view->title = "{$cuisineName}: {$categoryName}"; $this->view->headTitle("{$categoryName}", 'PREPEND'); $select = $fooditems->select()->order('total_rating DESC'); $dishesFound = $thisCategory->findDependentRowset('Model_DbTable_DishesComplete', 'Category', $select); $this->view->dishes = $dishesFound; } }