コード例 #1
0
 public function createAction()
 {
     $this->view->Title = "Quản lý nhóm sản phẩm";
     $this->view->headTitle($this->view->Title);
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest()->getParams();
         $error = $this->_checkForm($request);
         if (count($error) == 0) {
             $Product = new ProductGroup();
             $Product->merge($request);
             $Product->save();
             $this->Member->log('Nhóm sản phẩm:' . $Product->name . '(' . $Product->id . ')', 'Tạo mới');
             My_Plugin_Libs::setSplash('Nhóm sản phẩm: <b>' . $Product->name . '</b> đã tạo thành công. ');
             $this->_redirect($this->_helper->url('index', 'productgroup', 'admin'));
         }
         if (count($error)) {
             $this->view->error = $error;
         }
     }
 }