Overview

Classes

  • Quform
  • Quform_Admin_InsertForm
  • Quform_Admin_Page
  • Quform_Admin_Page_Controller
  • Quform_Admin_Page_Dashboard
  • Quform_Admin_Page_Entries
  • Quform_Admin_Page_Entries_Edit
  • Quform_Admin_Page_Entries_List
  • Quform_Admin_Page_Entries_View
  • Quform_Admin_Page_Factory
  • Quform_Admin_Page_Forms_Add
  • Quform_Admin_Page_Forms_Edit
  • Quform_Admin_Page_Forms_List
  • Quform_Admin_Page_Help
  • Quform_Admin_Page_Preview
  • Quform_Admin_Page_Settings
  • Quform_Admin_Page_Tools
  • Quform_Admin_Page_Tools_ExportEntries
  • Quform_Admin_Page_Tools_ExportForm
  • Quform_Admin_Page_Tools_Home
  • Quform_Admin_Page_Tools_ImportForm
  • Quform_Admin_Page_Tools_Migrate
  • Quform_Admin_Page_Tools_Uninstall
  • Quform_Api
  • Quform_Block
  • Quform_Builder
  • Quform_Captcha
  • Quform_ClassLoader
  • Quform_Confirmation
  • Quform_Container
  • Quform_Dashboard_Widget
  • Quform_Dispatcher
  • Quform_Element
  • Quform_Element_Captcha
  • Quform_Element_Checkbox
  • Quform_Element_Column
  • Quform_Element_Container
  • Quform_Element_Container_Iterator
  • Quform_Element_Date
  • Quform_Element_Email
  • Quform_Element_Factory
  • Quform_Element_Field
  • Quform_Element_File
  • Quform_Element_Group
  • Quform_Element_Hidden
  • Quform_Element_Honeypot
  • Quform_Element_Html
  • Quform_Element_Multi
  • Quform_Element_Multiselect
  • Quform_Element_Name
  • Quform_Element_Page
  • Quform_Element_Password
  • Quform_Element_Radio
  • Quform_Element_Recaptcha
  • Quform_Element_Row
  • Quform_Element_Select
  • Quform_Element_Submit
  • Quform_Element_Text
  • Quform_Element_Textarea
  • Quform_Element_Time
  • Quform_Entry_Controller
  • Quform_Entry_Exporter
  • Quform_Entry_List_Settings
  • Quform_Entry_List_Table
  • Quform_Entry_Processor
  • Quform_Entry_UserSearcher
  • Quform_Filter_Abstract
  • Quform_Filter_Alpha
  • Quform_Filter_AlphaNumeric
  • Quform_Filter_Digits
  • Quform_Filter_Regex
  • Quform_Filter_Static
  • Quform_Filter_StripTags
  • Quform_Filter_Trim
  • Quform_Form
  • Quform_Form_Controller
  • Quform_Form_Exporter
  • Quform_Form_Factory
  • Quform_Form_Importer
  • Quform_Form_Iterator
  • Quform_Form_List_Settings
  • Quform_Form_List_Table
  • Quform_Form_Processor
  • Quform_License
  • Quform_Migrator
  • Quform_NonceRefresher
  • Quform_Notification
  • Quform_Notification_Resender
  • Quform_Options
  • Quform_Permissions
  • Quform_Repository
  • Quform_ScriptLoader
  • Quform_Session
  • Quform_Settings
  • Quform_Shortcode
  • Quform_Themes
  • Quform_TokenReplacer
  • Quform_Toolbar
  • Quform_Translations
  • Quform_Updater
  • Quform_Upgrader
  • Quform_Uploader
  • Quform_Validator_Abstract
  • Quform_Validator_Alpha
  • Quform_Validator_AlphaNumeric
  • Quform_Validator_Array
  • Quform_Validator_Captcha
  • Quform_Validator_Date
  • Quform_Validator_Digits
  • Quform_Validator_Duplicate
  • Quform_Validator_Email
  • Quform_Validator_FileUpload
  • Quform_Validator_GreaterThan
  • Quform_Validator_Honeypot
  • Quform_Validator_Identical
  • Quform_Validator_InArray
  • Quform_Validator_Length
  • Quform_Validator_LessThan
  • Quform_Validator_Recaptcha
  • Quform_Validator_Regex
  • Quform_Validator_Required
  • Quform_Validator_Static
  • Quform_Validator_Time
  • Quform_View
  • Quform_ViewFactory
  • Quform_Widget_Form
  • Quform_Widget_Popup

Interfaces

  • Quform_Attachable
  • Quform_Element_Editable
  • Quform_Filter_Interface
  • Quform_Validator_Interface
  • Overview
  • Class

Class Quform_Element_Field

Quform_Element
Extended by Quform_Element_Field

Direct known subclasses

Quform_Element_Captcha, Quform_Element_Date, Quform_Element_Text, Quform_Element_Textarea, Quform_Element_Time, Quform_Element_Email, Quform_Element_File, Quform_Element_Hidden, Quform_Element_Honeypot, Quform_Element_Multi, Quform_Element_Name, Quform_Element_Password, Quform_Element_Recaptcha

Indirect known subclasses

Quform_Element_Checkbox, Quform_Element_Multiselect, Quform_Element_Radio, Quform_Element_Select
Abstract
Copyright: Copyright (c) 2009-2022 ThemeCatcher (https://www.themecatcher.net)
Located at Quform/Element/Field.php
Methods summary
public string
# getUniqueId( )

Get the unique element ID

Get the unique element ID

Returns

string

Overrides

Quform_Element::getUniqueId()
public string
# getName( )

Get the name of the element

Get the name of the element

Returns

string

Overrides

Quform_Element::getName()
public string
# getIdentifier( )

Get the element identifier (e.g. 1_1)

Get the element identifier (e.g. 1_1)

Returns

string

Overrides

Quform_Element::getIdentifier()
public string
# getFullyQualifiedName( )

Get the fully qualified name of the element

Get the fully qualified name of the element

Returns

string
public string
# render( array $context = array() )

Get the HTML for the element

Get the HTML for the element

Parameters

$context

Returns

string
protected array
# getElementClasses( array $context = array() )

Get the classes for the outermost element wrapper

Get the classes for the outermost element wrapper

Parameters

$context

Returns

array
protected string
# getLabelHtml( array $context = array(), string|boolean $forAttribute = true, boolean $id = false )

Get the HTML for the element label

Get the HTML for the element label

Parameters

$context
$forAttribute
Set the "for" attribute to the element unique ID
$id
Add a unique ID to the label

Returns

string
public string
# getLabel( array $context = array() )

Get the field label text

Get the field label text

Parameters

$context

Returns

string
protected array
# getInnerClasses( array $context = array() )

Get the classes for the element inner wrapper

Get the classes for the element inner wrapper

Parameters

$context

Returns

array
protected string
# getDescriptionHtml( string $which = 'below' )

Get the HTML for the element description

Get the HTML for the element description

Parameters

$which
Which description to get ('above' or 'below')

Returns

string
protected string
# getInputHtml( array $context = array() )

Get the HTML for the element input wrapper

Get the HTML for the element input wrapper

Parameters

$context

Returns

string
protected string
# getTooltip( )

Get the field tooltip

Get the field tooltip

Returns

string
protected array
# getInputClasses( array $context = array() )

Get the classes for the element input wrapper

Get the classes for the element input wrapper

Parameters

$context

Returns

array
abstract protected string
# getFieldHtml( array $context = array() )

Get the HTML for the field

Get the HTML for the field

Parameters

$context

Returns

string
protected string
# getFieldIconsHtml( )

Get the HTML for the field icons

Get the HTML for the field icons

Returns

string
public string
# getAdminLabel( )

Get the admin label

Get the admin label

Returns

string
public string
# getEditLabelHtml( )

Returns

string
public
# setIsMultiple( boolean $flag = true )

Set the flag that the element can have multiple values.

Set the flag that the element can have multiple values.

Parameters

$flag
public boolean
# isMultiple( )

Does this element have multiple values?

Does this element have multiple values?

Returns

boolean
public
# setBelongsTo( Quform_Element $belongsTo )

Set the parent element to which this one belongs to

Set the parent element to which this one belongs to

Parameters

$belongsTo

Returns


$this
public Quform_Element
# getBelongsTo( )

Get the name of the parent element to which this one belongs

Get the name of the parent element to which this one belongs

Returns

Quform_Element
public
# addFilter( Quform_Filter_Interface $filter )

Add a filter

Add a filter

Parameters

$filter
The instance of the filter
public
# clearFilters( )

Remove all filters

Remove all filters

public boolean
# hasFilters( )

Does this element have filters?

Does this element have filters?

Returns

boolean
public array
# getFilters( )

Get the filters

Get the filters

Returns

array
The array of filters
public boolean
# hasFilter( string|Quform_Filter_Interface $filter )

Does the element have the given filter?

Does the element have the given filter?

Parameters

$filter
The name or instance of the filter

Returns

boolean
public Quform_Filter_Interface|null
# getFilter( string $filter )

Get the filter with the given name

Get the filter with the given name

Parameters

$filter
The name of the filter

Returns

Quform_Filter_Interface|null
The filter or null if the element does not have the filter
public
# removeFilter( string $filter )

Remove a filter with the given name

Remove a filter with the given name

Parameters

$filter
The name of the filter
public
# addValidator( Quform_Validator_Interface $validator )

Add a validator

Add a validator

Parameters

$validator
The validator instance to add
public
# clearValidators( )

Remove all validators

Remove all validators

public boolean
# hasValidators( )

Does the element have any validators?

Does the element have any validators?

Returns

boolean
public Quform_Validator_Abstract[]
# getValidators( )

Get the validators

Get the validators

Returns

Quform_Validator_Abstract[]
The validators
public boolean
# hasValidator( string|Quform_Validator_Abstract $validator )

Does the element have the given validator?

Does the element have the given validator?

Parameters

$validator
The name or instance of the validator

Returns

boolean
public Quform_Validator_Abstract|null
# getValidator( string $validator )

Get the validator with the given name

Get the validator with the given name

Parameters

$validator
The name of the validator

Returns

Quform_Validator_Abstract|null
The validator or null if the element does not have the validator
public
# removeValidator( string $validator )

Remove a validator with the given name

Remove a validator with the given name

Parameters

$validator
The name of the validator
public boolean
# isRequired( )

Gets whether the element is required or not

Gets whether the element is required or not

Returns

boolean
public
# setDefaultValue( mixed $value )

Parameters

$value
public mixed
# getDefaultValue( )

Returns

mixed
public boolean
# hasDefaultValue( )

Returns

boolean
public
# setValue( mixed $value )

Set the value

Set the value

Parameters

$value
public
# setValueFromStorage( string $value )

Set the value from the database storage

Set the value from the database storage

Parameters

$value

Returns


$this
protected string
# convertValueFromStorage( string $value )

Convert the value from storage format to element format

Convert the value from storage format to element format

Parameters

$value

Returns

string
protected boolean
# isValidValue( string $value )

Is the given value valid for this element type

Is the given value valid for this element type

Parameters

$value

Returns

boolean
public string|array
# getValueRaw( )

Get the unfiltered (raw) value

Get the unfiltered (raw) value

Returns

string|array
public string
# getValue( )

Get the filtered value

Get the filtered value

Returns

string
public string
# getValueHtml( )

Get the value formatted in HTML

Get the value formatted in HTML

Returns

string
public string
# getValueText( string $separator = ', ' )

Get the value formatted in plain text

Get the value formatted in plain text

Parameters

$separator
The separator for array types (used by child classes)

Returns

string
public string
# getValueForStorage( )

Get the value for storage in the database

Get the value for storage in the database

Returns

string
protected string
# getConvertedValueForStorage( )

Convert the value from element format to storage format

Convert the value from element format to storage format

Returns

string
protected boolean
# shouldConvertToHidden( )

Should this element be converted to a hidden field?

Should this element be converted to a hidden field?

Currently, this only applies when non-visible fields have a dynamic default value

Returns

boolean
public boolean
# isValid( )

Is the data given for this element valid?

Is the data given for this element valid?

Returns

boolean
True if valid, false otherwise
public boolean
# hasError( )

Does the element have a validation error?

Does the element have a validation error?

Returns

boolean
public
# setError( string $message )

Set the validation error message

Set the validation error message

Deprecated

2.2.0 Use addError

Parameters

$message
public
# addError( string $message )

Add a validation error message

Add a validation error message

Parameters

$message
public
# clearError( )

Deprecated

2.2.0 Use clearErrors
public
# clearErrors( )

Clear the validation error messages

Clear the validation error messages

public string
# getError( )

Get the first validation error message

Get the first validation error message

Returns

string
public array
# getErrors( )

Get the validation error messages

Get the validation error messages

Returns

array
public
# getErrorArray( )

Get the validation error message for the front JS to process

Get the validation error message for the front JS to process

public
# reset( )

Reset the value to default

Reset the value to default

public
# setDynamicDefaultValue( string $key )

Sets the default value dynamically

Sets the default value dynamically

Parameters

$key
public string
# prepareDynamicValue( string $value )

Subclasses can alter the dynamic default value to suit

Subclasses can alter the dynamic default value to suit

Parameters

$value

Returns

string
$value
protected
# filterValue( string & $value )

Filter the given value by reference

Filter the given value by reference

Parameters

$value
protected
# filterValueRecursive( array & $value )

Recursively filter the given value by reference

Recursively filter the given value by reference

Parameters

$value
public boolean
# hasValue( mixed $value )

Does this element have the given value?

Does this element have the given value?

Parameters

$value

Returns

boolean
public string
# getEmptyValue( )

Returns

string
public boolean
# isEmpty( )

Does this element have an empty value?

Does this element have an empty value?

Returns

boolean
protected string
# getSubLabelHtml( string $which = 'below' )

Get the HTML for the sub label

Get the HTML for the sub label

Parameters

$which

Returns

string
protected string
# getErrorHtml( )

Get the HTML for this element's error (only shown when useAjax is false)

Get the HTML for this element's error (only shown when useAjax is false)

Returns

string
protected string
# renderCss( array $context = array() )

Render the CSS for this field

Render the CSS for this field

Parameters

$context

Returns

string

Overrides

Quform_Element::renderCss()
protected array
# getCssSelectors( )

Get the list of CSS selectors

Get the list of CSS selectors

Returns

array

Overrides

Quform_Element::getCssSelectors()
public boolean
# isLogicRuleMatch( array $rule )

Does the given logic rule match the current value?

Does the given logic rule match the current value?

This is overridden in child classes

Parameters

$rule

Returns

boolean
protected boolean
# isLogicValueMatch( mixed $value, array $rule )

Does the given logic rule match the given value?

Does the given logic rule match the given value?

Parameters

$value
$rule

Returns

boolean
Methods inherited from Quform_Element
__construct(), config(), getCss(), getCssSelector(), getForm(), getId(), getTranslation(), hasNonVisibleAncestor(), isConditionallyHidden(), isHidden(), isVisible(), prepareContext(), setConditionallyHidden(), setConfig(), setForm(), setHasNonVisibleAncestor(), setId(), setUniqueId()
Properties summary
protected mixed $defaultValue

The default value

The default value

#
protected mixed $value

Element value

Element value

#
protected array $filters

Element filters

Element filters

# array()
protected array $validators

Element validators

Element validators

# array()
protected array $errors

The current validation errors

The current validation errors

# array()
protected boolean $isMultiple

Is the element multiple input e.g. multiple select

Is the element multiple input e.g. multiple select

# false
protected Quform_Element $belongsTo

The name of the element that this belongs to

The name of the element that this belongs to

#
Properties inherited from Quform_Element
$config, $form, $hasNonVisibleAncestor, $id, $isConditionallyHidden, $uniqueId
API documentation generated by ApiGen