base.html.php
4 years ago
checkbox.html.php
4 years ago
file.html.php
4 years ago
hidden.html.php
4 years ago
html.html.php
4 years ago
label-content.html.php
4 years ago
label.html.php
4 years ago
radio.html.php
4 years ago
select.html.php
4 years ago
textarea.html.php
4 years ago
select.html.php
22 lines
| 1 | <?php /** @var Give\Framework\FieldsAPI\Select $field */ ?> |
| 2 | <select |
| 3 | name="give_<?php echo $field->getName(); ?>" |
| 4 | id="give-<?php echo $field->getName(); ?>" |
| 5 | <?php echo $field->getAllowMultiple() ? 'multiple' : ''; ?> |
| 6 | > |
| 7 | <?php if ( $placeholder = $field->getPlaceholder() ) : ?> |
| 8 | <option value=""><?php echo $placeholder; ?></option> |
| 9 | <?php endif; ?> |
| 10 | <?php foreach ( $field->getOptions() as $option ) : ?> |
| 11 | <?php $label = $option->getLabel(); ?> |
| 12 | <?php $value = $option->getValue(); ?> |
| 13 | <?php $default = $field->getDefaultValue() === $option->getValue(); ?> |
| 14 | <option |
| 15 | <?php echo $label ? "value={$value}" : ''; ?> |
| 16 | <?php echo $default ? 'selected' : ''; ?> |
| 17 | > |
| 18 | <?php echo $label ?: $value; ?> |
| 19 | </option> |
| 20 | <?php endforeach; ?> |
| 21 | </select> |
| 22 |