setLabel() public method

Adds a label to the group
public setLabel ( string $label )
$label string A label
Exemplo n.º 1
0
 /**
  * Adds a label to the group/field
  *
  * @param  string $text       A label
  * @param  array  $attributes The label's attributes
  *
  * @return Field              A field
  */
 public function label($text, $attributes = array())
 {
     // Create the Label element
     $for = $this->id ?: $this->name;
     $label = $this->app['former']->label($text, $for, $attributes);
     // Set label
     $this->label = $label;
     if ($this->group) {
         $this->group->setLabel($label);
     }
     return $this;
 }