Custom.php
3 days ago
Number.php
3 days ago
Open.php
3 days ago
OpenFactory.php
3 days ago
Option.php
3 days ago
OptionFactory.php
3 days ago
Open.php
42 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Setting\Control\Input; |
| 6 | |
| 7 | use AC\Setting\AttributeCollection; |
| 8 | use AC\Setting\Control\Input; |
| 9 | |
| 10 | class Open extends Input |
| 11 | { |
| 12 | protected ?string $append; |
| 13 | |
| 14 | public function __construct( |
| 15 | string $name, |
| 16 | ?string $type = null, |
| 17 | ?string $default = null, |
| 18 | ?string $placeholder = null, |
| 19 | ?AttributeCollection $attributes = null, |
| 20 | ?string $append = null |
| 21 | ) { |
| 22 | if (null === $type) { |
| 23 | $type = 'text'; |
| 24 | } |
| 25 | |
| 26 | parent::__construct($name, $type, $default, $placeholder, $attributes); |
| 27 | |
| 28 | $this->append = $append; |
| 29 | } |
| 30 | |
| 31 | public function has_append(): bool |
| 32 | { |
| 33 | return $this->append !== null; |
| 34 | } |
| 35 | |
| 36 | public function get_append(): ?string |
| 37 | { |
| 38 | return $this->append; |
| 39 | } |
| 40 | |
| 41 | } |
| 42 |