public function renderShow($category, $category_id)
 {
     $this->_model->setCategory($category_id);
     // declare template variables
     $this->template->category = $this->_model->getCategoryName();
     $this->template->feeds = $this->_model->getFeeds();
 }
 public function getAd($id)
 {
     $ad = $this->model->retrieveSingle($id);
     if (isset($ad->category)) {
         $modelCategory = new CategoryModel();
         $category = $modelCategory->getCategory($ad->category);
         $ad->categoryname = $category->name;
     }
     return $ad;
 }
 public function getAction()
 {
     $get = $this->app->request->get(array('id'), array('id' => 'int'));
     if (!$get['success']) {
         unset($get['result']);
         //Show errors
         $this->app->renderJson($get);
         return;
     }
     if ($get['success']) {
         $category = new CategoryModel();
         $this->app->renderJson(array('result' => $category->getCategory($get['result']['id'])) + (array) $get);
     }
 }