public function indexAction() { // init $this->init(); // get wines $this->view->wineArray = \Model\Wine::find(); // set main view $this->view->setMainView('block-module-wines/public-index'); }
public function deleteAction() { // init $this->init(); // get wine $wine = \Model\Wine::findFirstById($this->dispatcher->getParam('id')); // if form submitted if ($this->request->getPost('action') == 'delete') { // delete wine $wine->delete(); // redirect $this->response->redirect(ROOT . 'admin/wines/', true); } // set wine $this->view->wine = $wine; // set main view $this->view->setMainView('block-module-wines/admin-delete'); }