예제 #1
0
 /**
  * build form output and prepare form partials (header / footer / ..)
  * @param string $view
  */
 public function build($view = '')
 {
     if (isset($this->attributes['class']) and strpos($this->attributes['class'], 'form-inline') !== false) {
         $this->view = 'rapyd::dataform_inline';
         $this->orientation = 'inline';
     }
     if ($this->output != '') {
         return;
     }
     if ($view != '') {
         $this->view = $view;
     }
     $this->process();
     //callable
     if ($this->form_callable && $this->process_status == "success") {
         $callable = $this->form_callable;
         $result = $callable($this);
         if ($result && is_a($result, 'Illuminate\\Http\\RedirectResponse')) {
             $this->redirect = $result;
         }
         //reprocess if an error is added in closure
         if ($this->process_status == 'error') {
             $this->process();
         }
     }
     //cleanup submits if success
     if ($this->process_status == 'success') {
         $this->removeType('submit');
     }
     $this->buildButtons();
     $this->buildFields();
     $dataform = $this->buildForm();
     $this->output = $dataform->render();
     $sections = $dataform->renderSections();
     $this->header = $sections['df.header'];
     $this->footer = $sections['df.footer'];
     $this->body = @$sections['df.fields'];
     Rapyd::setForm($this);
 }
예제 #2
0
 /**
  * 
  *
  * @static 
  */
 public static function setForm($form)
 {
     return \Zofe\Rapyd\Rapyd::setForm($form);
 }