Skip to content

Commit 70c70c8

Browse files
committed
update
1 parent d4e7788 commit 70c70c8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Select.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Select implements Control
2323
protected string $autocomplete = '';
2424

2525
protected bool $multiple = false;
26+
protected int $size = 0;
2627

2728
public function __construct()
2829
{
@@ -35,6 +36,12 @@ public function multiple(): self
3536
return $this;
3637
}
3738

39+
public function size(int $size): self
40+
{
41+
$this->size = $size;
42+
return $this;
43+
}
44+
3845
public function name(string $name): self
3946
{
4047
$this->name = $name;
@@ -159,6 +166,9 @@ public function renderDom(\DOMDocument $doc): \DOMElement
159166
if ($this->multiple) {
160167
$select->setAttribute('multiple', 'multiple');
161168
}
169+
if ($this->size) {
170+
$select->setAttribute('size', strval($size));
171+
}
162172
if ($this->required) {
163173
$select->setAttribute('required', 'required');
164174
}

0 commit comments

Comments
 (0)