Exemplo n.º 1
0
 public function newAction()
 {
     $form = new Admin_Form_Region_New();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $values = $form->getValues();
             try {
                 $id = Yadda_Model_Region::create($values);
                 $this->getHelper('FlashMessenger')->addMessage('Region created.');
                 $this->_redirect($this->getHelper('ReturnUrl')->getUrl('/region/edit/id/' . $id));
             } catch (Yadda_Model_Exception $e) {
                 $this->view->flashMessages[] = 'Error: ' . $e->getMessage();
             }
         }
     }
     $this->view->form = $form;
 }
Exemplo n.º 2
0
 public function __construct($region)
 {
     parent::__construct();
     $this->setAction('/region/edit/id/' . $region['id']);
     $this->id->setAttrib('readonly', 'readonly');
 }