Ejemplo n.º 1
0
 /**
  * Add a new field to the group
  * @param string $fn
  * @param array $args
  * @return FormField
  */
 function __call($fn, $args)
 {
     $name = $args[0];
     $fullname = $this->name . '[' . $name . ']';
     $this->fields[$name] = \FormBuilder::field($this->form, $fullname, $fn);
     return $this->fields[$name];
 }
Ejemplo n.º 2
0
 /**
  * Add a radio option
  * @param string $value value of the option
  * @param null|string $label optional label
  * @return $this
  */
 function addOption($value, $label = null)
 {
     $this->fields[$value] = \FormBuilder::field($this->form, $this->name, 'radio')->value($value)->label($label ?: $value);
     return $this;
 }