Exemple #1
0
 /**
  * Display articles in category
  *
  * @param void
  * @access public
  * @author Nguyen Van Hiep
  *
  * @version 1.0
  * @since 1.0
  */
 public function action_view()
 {
     $uri = explode('/', Uri::string());
     $slug = str_replace('.html', '', $uri[1]);
     $cat = Model_Categories::get_cat_from_slug($slug);
     if (!$cat) {
         Response::redirect('common/404');
     }
     $arts = Model_Article::articles_of_cat($cat->id, $this->lang, $cat->art_display_by_order);
     switch ($cat->display_type) {
         case DS_SANPHAM:
             //Hien thi phan [san pham]
             $this->ds_sanpham($arts, $cat);
             break;
         case CHUNGNHAN:
             //Hien thi phan [san pham]
             $this->chungnhan($arts, $cat);
             break;
         case VECHUNGTOI:
             //Hien thi phan [chung toi]
             $this->vechungtoi($arts, $cat);
             break;
         case THUONGHIEU:
             $this->thuonghieu($arts, $cat);
             break;
         case DS_TINTUC:
             $ret = $this->article_list($arts, $cat);
             break;
             // hien thi khi click vao AM THUC
         // hien thi khi click vao AM THUC
         case DS_MONAN:
             $this->ds_monan($arts, $cat);
             break;
         case QUY_TRINH_SX:
             $ret = $this->quytrinh_sx($arts, $cat);
             break;
         default:
             break;
     }
 }