コード例 #1
0
 public function savecategoryAction()
 {
     if (!$this->_helper->acl('Admin')) {
         return $this->_helper->redirectCommon('gotoLogin');
     }
     $request = $this->getRequest();
     if (!$request->isPost()) {
         return $this->_helper->redirector('addcategory');
     }
     if (false === $this->_catalogModel->saveCategory($request->getPost())) {
         $this->view->categoryForm = $this->_getCategoryForm();
         return $this->render('addcategory');
     }
     $redirector = $this->getHelper('redirector');
     return $redirector->gotoRoute(array('action' => 'list'), 'admin');
 }