Class AdminPageFramework_FieldType_select
A select field lets the user select drop-down list items.
This class defines the select
field type.
Field Definition Arguments
Field Type Specific Arguments
- is_multiple - (optional, boolean) if this is set to true,
the
multiple
attribute will be inserted into the field input tag, which enables the multiple selections for the user.
Common Field Definition Arguments
For common field definition arguments, seeAdminPageFramework_Factory_Controller::addSettingField()
.
Example
array( 'field_id' => 'select', 'title' => __( 'Dropdown List', 'admin-page-framework-loader' ), 'type' => 'select', 'help' => __( 'This is the <em>select</em> field type.', 'admin-page-framework-loader' ), 'default' => 2, 'label' => array( 0 => __( 'Red', 'admin-page-framework-loader' ), 1 => __( 'Blue', 'admin-page-framework-loader' ), 2 => __( 'Yellow', 'admin-page-framework-loader' ), 3 => __( 'Orange', 'admin-page-framework-loader' ), ), )
Multiple Selection
array( 'field_id' => 'select_multiple_options', 'title' => __( 'Multiple', 'admin-page-framework-loader' ), 'help' => __( 'This is the <em>select</em> field type with multiple elements.', 'admin-page-framework' ), 'type' => 'select', 'is_multiple' => true, 'default' => array( 3, 4 ), // note that PHP array indices are zero-base, meaning the index count starts from 0 (not 1). 3 here means the fourth item of the array. array( 3, 4 ) will select the fourth and fifth elements. 'label' => array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'November', 'October', 'December' ), 'attributes' => array( 'select' => array( 'size' => 10, ), ), )
Grouping
array( 'field_id' => 'select_multiple_groups', 'title' => __( 'Grouping', 'admin-page-framework-loader' ), 'type' => 'select', 'default' => 'b', 'label' => array( 'alphabets' => array( 'a' => 'a', 'b' => 'b', 'c' => 'c', ), 'numbers' => array( 0 => '0', 1 => '1', 2 => '2', ), ), 'attributes' => array( 'select' => array( 'style' => "width: 200px;", ), 'option' => array( 1 => array( 'disabled' => 'disabled', 'style' => 'background-color: #ECECEC; color: #888;', ), ), 'optgroup' => array( 'style' => 'background-color: #DDD', ) ), )
Package: AdminPageFramework\Common\Form\FieldType
Since: 2.1.5
Since: 3.3.1 Changed to extend
Extends: AdminPageFramework_FieldType
Image: http://admin-page-framework.michaeluno.jp/image/common/form/field_type/select.png
Located at factory/_common/form/field_type/select/AdminPageFramework_FieldType_select.php
Since: 2.1.5
Since: 3.3.1 Changed to extend
AdminPageFramework_FieldType
from
AdminPageFramework_FieldType_Base
.Extends: AdminPageFramework_FieldType
Image: http://admin-page-framework.michaeluno.jp/image/common/form/field_type/select.png
Located at factory/_common/form/field_type/select/AdminPageFramework_FieldType_select.php
Methods summary
protected
string
|
#
getField( mixed $aField )
Returns the output of the field type. Returnsstring Since
2.1.5
3.0.0 Removed unnecessary parameters. 3.3.1 Changed from _replyToGetField() .Overrides |
Magic methods summary
Properties summary
public
array
|
$aFieldTypeSlugs |
#
Defines the field type slugs used for this field type. |
protected
array
|
$aDefaultKeys |
#
Defines the default key-values of this field type. |