Example #1
0
 /**
  * Prints out the field, wrapped in its group
  *
  * @return string
  */
 public function wrapAndRender()
 {
     // Dry syntax (hidden fields, plain fields)
     if ($this->isUnwrappable()) {
         $html = $this->render();
         // Control group syntax
     } elseif (Form::hasInstanceOpened()) {
         $html = $this->group->wrapField($this);
         // Classic syntax
     } else {
         $html = $this->currentFramework()->createLabelOf($this);
         $html .= $this->render();
     }
     return $html;
 }
Example #2
0
 /**
  * Dispatch a call over to Form
  *
  * @param string  $method     The method called
  * @param array   $parameters Its parameters
  *
  * @return Form
  */
 public function toForm($method, $parameters)
 {
     // Disregards if the method doesn't contain 'open'
     if (!Str::contains($method, 'open') and !Str::contains($method, 'Open')) {
         return false;
     }
     $form = new Form\Form($this->app, $this->app['url'], $this->app['former.populator']);
     return $form->openForm($method, $parameters);
 }