InputfieldSelector class

Build a page finding selector visually.

Concept by Avoine, Code by Ryan Cramer, Sponsored by Avoine


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the InputfieldSelector class also inherits all the methods and properties of: Inputfield, WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
InputfieldSelector::get(string $key)
mixed

Get property

 
InputfieldSelector::getDefaultSettings()
array

Return the default settings

 
InputfieldSelector::getParentPages(Template $template)
PageArray

Get parent pages of pages using the given template

 
InputfieldSelector::getSelectorInfo($field)
array

Returns an array of selector information for the given Field or field name

 
InputfieldSelector::getSettings()
array

Return the configured settings

 
InputfieldSelector::processInput(WireInputData $input)
$this

Process input submitted to this Inputfield

InputfieldSelector::render()
string

Primary Inputfield render method

InputfieldSelector::renderRow(string $select, string $subfield, string $opval)
string

Render a selector row <li>

 
InputfieldSelector::sanitizeSelectorString($selectorString)
string

Sanitize a selector string and return it

 
InputfieldSelector::set(string $key, mixed $value)
this Inputfield WireData

Set property

 
InputfieldSelector::setAttribute($key, $value)
InputfieldSelector WireData

Set an attribute to this Inputfield, overridden from Inputfield class

 
InputfieldSelector::setup()
None

Setup the shared structures and data used by Selector

 

Properties

NameReturnSummary 
InputfieldSelector::addIcon string [plus-circle] Icon used for the "Add Field" link. 
InputfieldSelector::addLabel string [Add Field] Text used for the "Add Field" link 
InputfieldSelector::allowAddRemove bool [true] Whether to allow adding new rows / removing existing rows 
InputfieldSelector::allowBlankValues bool [false] When no value is present, should it contribute to the selector? 
InputfieldSelector::allowModifiers bool [true] Allow use of modifiers like include, limit? 
InputfieldSelector::allowSubfieldGroups bool [true] Allow @grouping of subfields (like for page references)? 
InputfieldSelector::allowSubfields bool [true] Allow use of subfields? 
InputfieldSelector::allowSubselectors bool [true] Allow use of subselectors? 
InputfieldSelector::allowSystemCustomFields bool [false] Allow system custom fields to appear in field selects? 
InputfieldSelector::allowSystemNativeFields bool [true] Allow system native fields to appear in field selects? 
InputfieldSelector::allowSystemTemplates bool [false] Allow selection of system templates (user, role, etc.)? 
InputfieldSelector::checkboxClass string 
InputfieldSelector::counter bool [true] Whether to show a live "number of matches" indicator. 
InputfieldSelector::dateFormat string [Y-m-d] Default PHP date() format for date fields. 
InputfieldSelector::datePlaceholder string [yyyy-mm-dd] Placeholder attribute text for date fields. 
InputfieldSelector::exclude string One or more (CSV) fields to disallow selection for 
InputfieldSelector::groupIdentifier string (1) 
InputfieldSelector::initTemplate Template null [null] Optional context template, used only just 1 allowed (pulled from $initValue automatically). 
InputfieldSelector::initValue string [selector string] Initial value that user can't change. 
InputfieldSelector::inputClass string 
InputfieldSelector::lastSelector string 
InputfieldSelector::limitFields array [empty] Selectable fields whitelist (field names). Leave empty to allow any. 
InputfieldSelector::maxSelectOptions int If quantity of select options exceeds this number, use autocomplete instead for Page reference fields 3.0.148 
InputfieldSelector::maxUsers int [20] Maximum number of users selectable. If more than regular text input used rather than select. 
InputfieldSelector::optgroupsOrder string [system,field,subfield,group,modifier,adjust] Order and presence of field selection option groups. 
InputfieldSelector::parseVars bool [true] Whether variables in a selector should be parsed and converted to values 
InputfieldSelector::preview bool [true] Whether to show a live preview of selector in notes section. 
InputfieldSelector::previewColumns string array [name,template,id] Array or CSV string of columns to show in bookmark previews 
InputfieldSelector::selectClass string 
InputfieldSelector::showFieldLabels bool int [false] Show field labels rather than names? Or specify integer 2 to show both. 
InputfieldSelector::showOptgroups bool [true] Whether or not to separate sytem, field, subfields, etc. into their own optgroups. If turned off, all types of fields will be shown together A-Z. 
InputfieldSelector::subfieldIdentifier string ... 
InputfieldSelector::timeFormat string [H:i] Default PHP date() format for time component of date fields. 
InputfieldSelector::timePlaceholder string [hh:mm] Placeholder attribute time component of date fields. 
InputfieldSelector::value string [selector string] Value that user can change. 

Additional methods and properties

In addition to the methods and properties above, InputfieldSelector also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252