Example #1
0
 protected function popular($arg = null)
 {
     $tab = $this->checkArg($arg);
     $pag = new Pagination(2, $this->products_m->getNumberOfPopularPro());
     $this->products = $this->products_m->getPopular(2, $pag->page($this->args[1]));
     $next = $pag->next();
     $prev = $pag->prev();
     $this->render('home', array('categories' => $this->categories, 'products' => $this->products, 'slider' => $this->slider, 'd_product' => $this->d_product, 'next' => $next, 'prev' => $prev, 'action' => $this->action, 'popular' => true, 'ids' => $this->category_ids, 'tab' => $tab, 'selected' => $this->args[1]));
 }
Example #2
0
 protected function search($arg = null)
 {
     $http = new Http();
     $search = $http->get('search');
     $search_m = new Search($search);
     $pag = new Pagination(2, $search_m->getNumberoOfMached());
     $products = $search_m->getProducts(2, $pag->page($arg[1]));
     $next = $pag->next();
     $prev = $pag->prev();
     $this->render('search', array('categories' => $this->categories, 'products' => $products, 'ids' => $this->category_ids, 'slider' => $this->slider, 'd_product' => $this->d_product, 'next' => $next, 'prev' => $prev, 'action' => $this->action, 'page' => $arg[1], 'tab' => $arg[0], 'search' => $search));
 }