public function showCategories() { $categoryModel = new Category(); $categories = $categoryModel->getAllCategories(10); var_dump($categories); die; }
public function indexAction() { $componentMenu = new TopMenuComponent($this); $componentMenuResp = $componentMenu->toString(); $categoriesTbl = new Category(); $cats = $categoriesTbl->getAllCategories(); if ($_POST && isset($_POST['remove'])) { if ($categoriesTbl->removeCategories($_POST['remove'])) { $this->addNotify('Успешно удалено'); } else { $this->addNotify('Удаление не выполнено'); } $this->redirect('backend_categories'); } $componentNotify = new NotifyComponent($this); $componentNotifyResp = $componentNotify->toString(); $this->render(array('componentMenu' => $componentMenuResp, 'componentNotify' => $componentNotifyResp, 'categories' => $cats), 'Backend/Category/index.html'); }