Ejemplo n.º 1
0
 public function showProducts()
 {
     $productModel = new Product();
     $products = $productModel->getAllProducts(array(), 10);
     var_dump($products);
     die;
 }
 public function indexAction()
 {
     $component = new TopMenuComponent($this);
     $componentResp = $component->toString();
     $productTbl = new Product();
     if ($_POST && isset($_POST['remove'])) {
         if ($productTbl->removeProducts($_POST['remove'])) {
             $this->addNotify('Успешно удалено');
         } else {
             $this->addNotify('Удаление не выполнено');
         }
         $this->redirect('backend_products');
     }
     $filter = new MainFilter($this);
     $data = array(array('id' => 0, 'name' => 'Все статусы'), array('id' => 'visible', 'name' => 'Видимые'), array('id' => 'hidden', 'name' => 'Скрытые'));
     $filter->addFSelect('visible', 'Видимость', $data);
     $products = $productTbl->getAllProducts($filter->getData());
     $componentNotify = new NotifyComponent($this);
     $componentNotifyResp = $componentNotify->toString();
     $this->render(array('filterR' => $filter->render(), 'componentMenu' => $componentResp, 'products' => $products, 'componentNotify' => $componentNotifyResp), 'Backend/Product/index.html');
 }