SilverWare\Select2\Forms\Select2Field
An extension of the dropdown field class for a Select2 field.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class Select2Field
extends DropdownField
{
- // members
- private static array $default_config = ;
- protected $config;
- protected boolean $multiple = false;
- // methods
- public void __construct()
- public string Type()
- public DBHTMLText Field()
- public ArrayList getOptions()
- public $this setConfig()
- public mixed getConfig()
- public $this setMultiple()
- public boolean getMultiple()
- public string getMultipleName()
- public boolean isMultiple()
- public boolean usesTags()
- public array getAttributes()
- public array getDataAttributes()
- public $this setValue()
- public boolean isSelectedValue()
- public array getValueArray()
- public void loadFrom()
- public void saveInto()
- public void loadFromRelation()
- public void saveIntoRelation()
- public boolean validate()
- public string stringEncode()
- public array stringDecode()
- protected string getDataValue()
- protected array getFieldConfig()
- protected Relation getNamedRelation()
Hierarchy
Extends
- SilverStripe\Forms\DropdownField
Members
private
- $default_config
—
array
An array which defines the default configuration for instances.
protected
- $config
—
array
An array which holds the configuration for an instance. - $multiple
—
boolean
Defines whether the field can handle multiple options.
Methods
protected
- getDataValue() — Converts the given data value to a string suitable for a data attribute.
- getFieldConfig() — Answers the field config for the receiver.
- getNamedRelation() — Answers the relation with the field name from the given data object.
public
- __construct() — Constructs the object upon instantiation.
- Field() — Renders the field for the template.
- Type() — Answers the field type for the template.
- getAttributes() — Answers an array of HTML attributes for the field.
- getConfig() — Answers either the named config value, or the config array.
- getDataAttributes() — Answers an array of data attributes for the field.
- getMultiple() — Answers the value of the multiple attribute.
- getMultipleName() — Answers the multiple name of the field.
- getOptions() — Answers an array list containing the options for the field.
- getValueArray() — Answers the value(s) of this field as an array.
- isMultiple() — Answers true if the field handles multiple tags.
- isSelectedValue() — Answers true if the current value of this field matches the given option value.
- loadFrom() — Loads the value of the field from the given data object.
- loadFromRelation() — Loads the value of the field from the given relation.
- saveInto() — Saves the value of the field into the given data object.
- saveIntoRelation() — Saves the value of the field into the given relation.
- setConfig() — Defines either the named config value, or the config array.
- setMultiple() — Defines the value of the multiple attribute.
- setValue() — Defines the value of the field.
- stringDecode() — Decodes the given string of values into an array.
- stringEncode() — Converts the given array of values into a string.
- usesTags() — Answers true if the field is configured to use tags.
- validate() — Performs validation on the receiver.