コード例 #1
0
ファイル: Fieldset.php プロジェクト: agilesdesign/Element
 public function __construct($disabled = false)
 {
     parent::__contruct();
     if ($disabled) {
         parent::setAttribute((new Attribute('disabled'))->append('disabled'));
     }
 }
コード例 #2
0
ファイル: Select.php プロジェクト: agilesdesign/Element
 public function __construct($multiple = false)
 {
     parent::__contruct();
     if ($multiple) {
         parent::setAttribute((new Attribute('multiple'))->append(''));
     }
 }
コード例 #3
0
ファイル: Link.php プロジェクト: agilesdesign/Element
 public function __construct($href, $rel, $type = null)
 {
     parent::__construct();
     parent::setAttribute((new Attribute('href'))->append($href));
     parent::setAttribute((new Attribute('rel'))->append($rel));
     if (isset($type)) {
         parent:
         setAttribute((new Attribute('type'))->append($type));
     }
 }
コード例 #4
0
ファイル: Textarea.php プロジェクト: agilesdesign/Element
 public function __construct($placeholder = null, $rows = null)
 {
     parent::__construct();
     if (isset($placeholder)) {
         parent::setAttribute((new Attribute('placeholder'))->append($placeholder));
     }
     if (isset($rows)) {
         parent::setAttribute((new Attribute('rows'))->append($rows));
     }
 }
コード例 #5
0
ファイル: RadioGroup.php プロジェクト: gobline/form
 public function setAttribute($name, $value)
 {
     parent::setAttribute($name, $value);
     if ($name !== 'id') {
         foreach ($this->radioElements as $element) {
             $element->setAttribute($name, $value);
         }
     }
     return $this;
 }
コード例 #6
0
ファイル: Input.php プロジェクト: agilesdesign/Element
 public function __construct($type, $name, $readonly = false, $disabled = false)
 {
     parent::__construct();
     parent::setAttribute('type', $type);
     parent::setAttribute('name', $name);
     if ($readonly) {
         parent::setAttribute((new Attribute('readonly'))->append('readonly'));
     }
     if ($disabled) {
         parent::setAttribute((new Attribute('disabled'))->append('disabled'));
     }
 }
コード例 #7
0
ファイル: Script.php プロジェクト: agilesdesign/Element
 public function __construct($src = null, $type = null, $defer = false, $async = false)
 {
     parent::__construct();
     if (isset($src)) {
         parent::setAttribute((new Attribute('src'))->append($src));
     }
     if (isset($type)) {
         parent::setAttribute((new Attribute('type'))->append($type));
     }
     if ($defer) {
         parent::setAttribute((new Attribute('defer'))->append($defer));
     }
     if ($async) {
         parent::setAttribute((new Attribute('async'))->append($async));
     }
 }
コード例 #8
0
ファイル: Cite.php プロジェクト: agilesdesign/Element
 public function __construct($title)
 {
     parent::construct();
     parent::setAttribute((new Attribute('title'))->append($title));
 }
コード例 #9
0
ファイル: InlineFrame.php プロジェクト: agilesdesign/Element
 public function __construct($src)
 {
     parent::__construct();
     parent::setAttribute((new Attribute('src'))->append($src));
 }
コード例 #10
0
ファイル: Time.php プロジェクト: agilesdesign/Element
 public function __construct($datetime)
 {
     parent::__construct();
     parent::setAttribute((new Attribute('datetime'))->append($datetime));
 }