Example #1
0
 /**
  * Add a label
  *
  * @return void
  * @author Justin Palmer
  **/
 public static function setLabel($key, $value)
 {
     if (!self::$Labels instanceof Hash) {
         self::$Labels = new Hash();
     }
     self::$Labels->set($key, $value);
 }
Example #2
0
 /**
  * return a Label for a model property
  *
  * @see Label
  * @return Label
  * @author Justin Palmer
  **/
 public function label($property, $text, $options = '')
 {
     $name = $this->getElementName($property);
     $options = $this->checkForErrors($property, $options);
     FlashForm::setLabel($name, $text);
     $hint = '';
     //var_dump($this->model->schema()->required);
     if ($this->model !== null && in_array($property, $this->model->schema()->required)) {
         $hint = self::$required_hint;
     }
     $id = $this->model !== null ? $this->model->alias() . "_{$property}" : $property;
     return new Span($hint, "class:" . self::$class) . new Label($text, $id . "_id", $options);
 }