Custom.php
4 days ago
Number.php
4 days ago
Open.php
4 days ago
OpenFactory.php
4 days ago
Option.php
4 days ago
OptionFactory.php
4 days ago
Custom.php
37 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 | final class Custom extends Input |
| 11 | { |
| 12 | private array $data; |
| 13 | |
| 14 | public function __construct( |
| 15 | string $name, |
| 16 | ?string $type = null, |
| 17 | array $data = [], |
| 18 | $value = null, |
| 19 | ?string $placeholder = null, |
| 20 | ?AttributeCollection $attributes = null |
| 21 | ) { |
| 22 | if ($type === null) { |
| 23 | $type = $name; |
| 24 | } |
| 25 | |
| 26 | parent::__construct($name, $type, $value, $placeholder, $attributes); |
| 27 | |
| 28 | $this->data = $data; |
| 29 | } |
| 30 | |
| 31 | public function get_data(): array |
| 32 | { |
| 33 | return $this->data; |
| 34 | } |
| 35 | |
| 36 | } |
| 37 |