Example #1
0
 /**
  *
  * @return \Simplify\URL
  */
 public function url()
 {
     /*return new URL(null, array(
           'formAction' => $this->getName()
       ));*/
     return $this->form->url()->extend()->set('formAction', $this->getName());
 }
Example #2
0
 /**
  * (non-PHPdoc)
  *
  * @see \Simplify\Controller::indexAction()
  */
 protected function indexAction()
 {
     try {
         $result = $this->Form->execute();
         if ($result == \Simplify\Form::RESULT_SUCCESS) {
             \Simplify::session()->notices('Success');
             return \Simplify::response()->redirect($this->Form->url()->extend()->set('formAction', null));
         }
     } catch (\Simplify\ValidationException $e) {
         \Simplify::session()->warnings(__('Verifique os erros abaixo'));
         $errors = (array) $e->getErrors();
         foreach ($errors as $key => $errors) {
             if (is_int($key)) {
                 \Simplify::session()->warnings($errors);
             }
         }
     } catch (\Exception $e) {
         \Simplify::session()->warnings($e->getMessage());
     }
     $this->set('formBody', $this->Form->render());
 }