Пример #1
0
 /**
  * Prints out the current label
  *
  * @param  string $field The field to create a label for
  * @return string        A <label> tag
  */
 private function getLabel($field)
 {
     if (!$this->label or !array_get($this->label, 'label')) {
         return false;
     }
     extract($this->label);
     // Add bootstrap class if necessary
     $attributes = Framework::getLabelClasses($attributes);
     // Get the field name to link the label to it
     $name = $field->name;
     if ($field->type == 'checkboxes' or $field->type == 'radios') {
         return '<label' . HTML::attributes($attributes) . '>' . $label . '</label>';
     }
     return \Form::label($name, $label, $attributes);
 }
Пример #2
0
 /**
  * Prints out the current label
  *
  * @param  string $field The field to create a label for
  * @return string        A <label> tag
  */
 private function getLabel($field)
 {
     $this->label['attributes'] = Framework::getLabelClasses($this->label['attributes']);
     return Framework::label($field, $this->label);
 }
Пример #3
0
 public static function renderLabel($label, $field)
 {
     // Get the label and its informations
     extract($label);
     // Add classes to the attributes
     $attributes = Framework::getLabelClasses($attributes);
     // Append required text
     if ($field->isRequired()) {
         $label .= Config::get('required_text');
     }
     // Get the field name to link the label to it
     if ($field->isCheckable()) {
         return '<label' . HTML::attributes($attributes) . '>' . $label . '</label>';
     }
     return \Form::label($field->name, $label, $attributes);
 }