value. Default: []. * @var bool $withEmpty Optional. True to add an empty option. Default: false. * @var bool $required Optional. True to set the field as required. Default: false. * @var string $value Optional. The field value. Default: "". * @var string $trigger Optional. For JS. The CSS classname for jQuery. Default: null. * @var string $tooltip Optional. The tooltip content. Default: "". * @var string $tooltip_pos Optional. The tooltip position. Default: "center". * @var string $class Optional. Additional CSS classname. Default: null. * @var string $identifier Optional. The field identifier. Default: null. * @var array $hide_subset_current_options Optional. Array of eligible options to be hidden if current. Default: []. * @var bool $readonly Optional. Render as non-interactive; value is still submitted. Default: false. */ # Name if (!isset($name)) { throw new Exception("Attribute 'name' is required on Select field"); } # Defaults $label = $label ?? ""; $value = $value ?? ""; $options = $options ?? []; $withEmpty = $withEmpty ?? false; $required = $required ?? false; $id = $identifier ?? ''; $tooltip_pos = $tooltip_pos ?? "top"; $hide_subset_current_options = $hide_subset_current_options ?? []; $readonly = $readonly ?? false; # JS actions $trigger = isset($trigger) ? "js-backwpup-$trigger" : ""; # CSS $class = $class ?? ""; ?>
"toggle", "size" => "small"]); ?>