Colorpicker.php
4 years ago
Field.php
4 years ago
File.php
4 years ago
Group.php
4 years ago
Media.php
4 years ago
Radio.php
4 years ago
Select.php
4 years ago
Text.php
4 years ago
Textarea.php
4 years ago
Wysiwyg.php
4 years ago
Select.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\FormAPI\Form; |
| 4 | |
| 5 | class Select extends Field |
| 6 | { |
| 7 | |
| 8 | /** |
| 9 | * @var array |
| 10 | */ |
| 11 | public $options = []; |
| 12 | |
| 13 | /** |
| 14 | * @inheritDoc |
| 15 | */ |
| 16 | public function parse($array) |
| 17 | { |
| 18 | parent::parse($array); |
| 19 | |
| 20 | $this->options = isset($array[ 'options' ]) ? $array[ 'options' ] : []; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @inheritDoc |
| 25 | */ |
| 26 | public function toArray() |
| 27 | { |
| 28 | return array_merge( |
| 29 | parent::toArray(), |
| 30 | [ |
| 31 | 'options' => $this->options, |
| 32 | ] |
| 33 | ); |
| 34 | } |
| 35 | } |
| 36 |