Esempio n. 1
0
 public function label($val = NULL)
 {
     if ($val === NULL) {
         // Do not display labels for checkboxes, labels wrap checkboxes
         return '';
     } else {
         $this->data['label'] = $val === TRUE ? utf8::ucwords(inflector::humanize($this->name)) : $val;
         return $this;
     }
 }
Esempio n. 2
0
 /**
  * Sets or returns the input label.
  *
  * @chainable
  * @param   string   label to set
  * @return  string|object
  */
 public function label($val = NULL)
 {
     if ($val === NULL) {
         if (isset($this->data['name']) and isset($this->data['label'])) {
             return form::label($this->data['name'], $this->data['label']);
         }
         return FALSE;
     } else {
         $this->data['label'] = $val === TRUE ? utf8::ucwords(inflector::humanize($this->name)) : $val;
         return $this;
     }
 }
Esempio n. 3
0
 /**
  * Formatted title text
  *
  * @param	  string  $title
  * @param   bool    $format text
  * @return  string
  */
 public static function title($title, $format = true)
 {
     return html::specialchars($title);
     return html::specialchars($format ? utf8::ucwords(utf8::strtolower($title)) : $title);
 }
Esempio n. 4
0
 /**
  * Sets or returns the input label.
  *
  * @chainable
  * @param   string   label to set
  * @return  string|object
  */
 public function label($val = nil)
 {
     if ($val === nil) {
         if (isset($this->data['name']) and isset($this->data['label'])) {
             if ($this->has_rule('required')) {
                 $extra_text .= '<span class="required">*</span>';
             }
             return form::label($this->data['name'], $this->data['label'] . $extra_text);
         }
         return NO;
     } else {
         $this->data['label'] = $val === YES ? utf8::ucwords(inflector::humanize($this->name)) : $val;
         return $this;
     }
 }