Example #1
0
 public function __construct($name, $value = null, $options = array(1, 0))
 {
     parent::__construct('Checkbox', $name);
     if (empty($options)) {
         $options = array(1, 0);
     }
     list($checked, $unchecked) = $options;
     if ($value == $checked) {
         $this->setAttribute('checked', 'checked');
     }
     $this->setAttribute('value', $checked);
 }
Example #2
0
 public function __construct($name, $value = null)
 {
     parent::__construct('Radio', $name);
     $this->setAttribute('value', $value);
 }
Example #3
0
 public function __construct($name)
 {
     parent::__construct('Password', $name);
 }
Example #4
0
 public function __construct($name, $src, $label = null)
 {
     parent::__construct('Image', $name);
     $this->setAttribute('src', $src);
     $this->setAttribute('alt', $label);
 }
Example #5
0
 public function __construct($name, $value)
 {
     parent::__construct('Hidden', $name);
     $this->setAttribute('value', $value);
 }
Example #6
0
 public function __construct($name, $label)
 {
     parent::__construct('Button', $name);
     $this->setAttribute('value', $label);
 }