Exemplo n.º 1
0
 /**
  * Constructor for the checkbox.
  *
  * @param $label The label of the checkbox.
  * @param $name The name of the checkbox used for the name='' attribute of the HTML output
  * @param $description A description of the field.
  * @param $value A value to assign to this checkbox.
  */
 public function __construct($label = "", $name = "", $value = "", $description = "")
 {
     Element::__construct($label, $description);
     parent::__construct($name);
     $this->setCheckedValue($value);
     $this->setRenderLabel(false);
 }
Exemplo n.º 2
0
 public function getCSSClasses()
 {
     $classes = parent::getCSSClasses();
     if ($this->error) {
         $classes .= "error ";
     }
     if ($this->getRequired()) {
         $classes .= "required ";
     }
     return trim($classes);
 }