Пример #1
0
 public function editAction()
 {
     $request = $this->getRequest();
     $id = $request->getParam('id');
     $id = $this->_helper->IdConvert->hexToStr($id);
     $logic = new Logic_GroupMain();
     $form = new Logic_GroupMain_Form_Generic();
     if ($request->isPost()) {
         if ($form->isCancelled($this->getRequest()->getPost())) {
             $this->_helper->redirector('index');
             return;
         }
         if ($form->isValid($request->getPost())) {
             try {
                 $logic->update($form, $id);
                 $this->_helper->messenger("success", 'Group group was successfully edited.');
                 $this->_helper->redirector('index');
                 return;
             } catch (Logic_GroupMain_Exception $e) {
                 $this->_helper->messenger('error', MSG_ERROR, $e);
             }
         }
     } else {
         $model = new GroupMain();
         $data = $model->findOne($id);
         $form->setDefaults($data->toArray());
     }
     $this->view->form = $form;
 }
Пример #2
0
 public function showGroupMainDetails($id)
 {
     $item = new GroupMain();
     //return $item->findOne($id);
     $data = $item->findOne($id);
     return $data['group_main_name'];
 }