Zend\Form\Element\Select
Synopsis
class Select
extends Element
implements
InputProviderInterface
{
- // members
- protected array $attributes;
- protected ValidatorInterface $validator;
- protected bool $disableInArrayValidator;
- protected bool $emptyOption;
- protected array $valueOptions;
- // Inherited members from Element
- protected array $attributes;
- protected null|string $label;
- protected array $labelAttributes;
- protected array $labelOptions;
- protected array $messages;
- protected array $options;
- protected mixed $value;
- // methods
- public array getValueOptions()
- public Select setValueOptions()
- public self unsetValueOption()
- public Select|ElementInterface setOptions()
- public Select|ElementInterface setAttribute()
- public Select setDisableInArrayValidator()
- public bool disableInArrayValidator()
- public Select setEmptyOption()
- public string|null getEmptyOption()
- protected ValidatorInterface getValidator()
- public array getInputSpecification()
- protected array getValueOptionsValues()
- protected void getOptionValue()
- // Inherited methods from Element
- public void __construct()
- public void init()
- public Element|ElementInterface setName()
- public string|int getName()
- public Element|ElementInterface setOptions()
- public array getOptions()
- public NULL|mixed getOption()
- public self setOption()
- public Element|ElementInterface setAttribute()
- public mixed|null getAttribute()
- public ElementInterface removeAttribute()
- public bool hasAttribute()
- public Element|ElementInterface setAttributes()
- public array|Traversable getAttributes()
- public ElementInterface removeAttributes()
- public Element|ElementInterface clearAttributes()
- public Element setValue()
- public mixed getValue()
- public Element|ElementInterface setLabel()
- public null|string getLabel()
- public Element|ElementInterface setLabelAttributes()
- public array getLabelAttributes()
- public Element|ElementInterface setLabelOptions()
- public array getLabelOptions()
- public Element|ElementInterface clearLabelOptions()
- public ElementInterface removeLabelOptions()
- public Element|ElementInterface setLabelOption()
- public mixed|null getLabelOption()
- public ElementInterface removeLabelOption()
- public bool hasLabelOption()
- public Element|ElementInterface setMessages()
- public array|Traversable getMessages()
Hierarchy
Tasks
Line | Task |
---|---|
144 | Deprecate this |
Members
protected
- $attributes
—
array
Seed attributes - $attributes — array
- $disableInArrayValidator — Zend\Form\Element\bool
- $emptyOption
—
Zend\Form\Element\bool
Create an empty option (option with label but no value). If set to null, no option is created - $label — Zend\Form\null|string
- $labelAttributes — array
- $labelOptions
—
array
Label specific options - $messages — array
- $options — array
- $validator — \Zend\Validator\ValidatorInterface
- $value — mixed
- $valueOptions — array
Methods
protected
- getOptionValue()
- getValidator() — Get validator
- getValueOptionsValues() — Get only the values from the options attribute
public
- disableInArrayValidator() — Get the disable in array validator flag.
- getEmptyOption() — Return the string for the empty option (null if none)
- getInputSpecification() — Provide default input rules for this element
- getValueOptions()
- setAttribute() — Set a single element attribute
- setDisableInArrayValidator() — Set the flag to allow for disabling the automatic addition of an InArray validator.
- setEmptyOption() — Set the string for an empty option (can be empty string). If set to null, no option will be added
- setOptions() — Set options for an element. Accepted options are: - label: label to associate with the element - label_attributes: attributes to use when the label is rendered - value_options: list of values and labels for the select options _ empty_option: should an empty option be prepended to the options ?
- setValueOptions()
- unsetValueOption()
Inherited from Zend\Form\Element
public
- clearAttributes() — Clear all attributes
- clearLabelOptions() — Clear all label options
- getAttribute() — Retrieve a single element attribute
- getAttributes() — Retrieve all attributes at once
- getLabel() — Retrieve the label used for this element
- getLabelAttributes() — Get the attributes to use with the label
- getLabelOption() — Retrieve a single label option
- getLabelOptions() — Get label specific options
- getMessages() — Get validation error messages, if any.
- getName() — Get value for name
- getOption() — Return the specified option
- getOptions() — Get defined options
- getValue() — Retrieve the element value
- hasAttribute() — Does the element has a specific attribute ?
- hasLabelOption() — Does the element has a specific label option ?
- init() — This function is automatically called when creating element with factory. It allows to perform various operations (add elements...)
- removeAttribute() — Remove a single attribute
- removeAttributes() — Remove many attributes at once
- removeLabelOption() — Remove a single label option
- removeLabelOptions() — Remove many attributes at once
- setAttribute() — Set a single element attribute
- setAttributes() — Set many attributes at once
- setLabel() — Set the label used for this element
- setLabelAttributes() — Set the attributes to use with the label
- setLabelOption() — Set a single label optionn
- setLabelOptions() — Set many label options at once
- setMessages() — Set a list of messages to report when validation fails
- setName() — Set value for name
- setOption() — Set a single option for an element
- setOptions() — Set options for an element. Accepted options are: - label: label to associate with the element - label_attributes: attributes to use when the label is rendered - label_options: label specific options
- setValue() — Set the element value