示例#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);
 }
示例#2
0
文件: Radio.php 项目: joksnet/php-old
 public function __construct($name, $value = null)
 {
     parent::__construct('Radio', $name);
     $this->setAttribute('value', $value);
 }
示例#3
0
 public function __construct($name)
 {
     parent::__construct('Password', $name);
 }
示例#4
0
文件: Image.php 项目: joksnet/php-old
 public function __construct($name, $src, $label = null)
 {
     parent::__construct('Image', $name);
     $this->setAttribute('src', $src);
     $this->setAttribute('alt', $label);
 }
示例#5
0
 public function __construct($name, $value)
 {
     parent::__construct('Hidden', $name);
     $this->setAttribute('value', $value);
 }
示例#6
0
 public function __construct($name, $label)
 {
     parent::__construct('Button', $name);
     $this->setAttribute('value', $label);
 }