Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe FormField
+ Graphe d'héritage de FormField:

Fonctions membres publiques

 __construct ($form=null)
 
 __get ($name)
 
 __set ($name, $value)
 
 setForm (Form $form)
 
 setup (\SimpleXMLElement $element, $value, $group=null)
 
 setValue ($value)
 
 getAttribute ($name, $default=null)
 
 getDataAttributes ()
 
 renderDataAttributes ()
 
 render ($layoutId, $data=array())
 
 renderField ($options=array())
 
 filter ($value, $group=null, Registry $input=null)
 
 validate ($value, $group=null, Registry $input=null)
 
 postProcess ($value, $group=null, Registry $input=null)
 
- Fonctions membres publiques hérités de DatabaseAwareInterface
 setDatabase (DatabaseInterface $db)
 

Champs de données

 $repeat = false
 

Fonctions membres protégées

 getId ($fieldId, $fieldName)
 
 getInput ()
 
 getTitle ()
 
 getLabel ()
 
 getName ($fieldName)
 
 getFieldName ($fieldName)
 
 getLayoutData ()
 
 getLayoutPaths ()
 
 getRenderer ($layoutId='default')
 
 isDebugEnabled ()
 

Attributs protégés

 $description
 
 $hint
 
 $autocomplete = 'on'
 
 $spellcheck = true
 
 $autofocus = false
 
 $element
 
 $form
 
 $formControl
 
 $hidden = false
 
 $hiddenLabel = false
 
 $hiddenDescription = false
 
 $translateLabel = true
 
 $translateDescription = true
 
 $translateHint = true
 
 $id
 
 $input
 
 $label
 
 $multiple = false
 
 $pattern
 
 $validationtext
 
 $name
 
 $fieldname
 
 $group
 
 $required = false
 
 $disabled = false
 
 $readonly = false
 
 $type
 
 $validate
 
 $value
 
 $default
 
 $size
 
 $class
 
 $labelclass
 
 $onchange
 
 $onclick
 
 $showon
 
 $parentclass
 
 $layout
 
 $renderLayout = 'joomla.form.renderfield'
 
 $renderLabelLayout = 'joomla.form.renderlabel'
 
 $dataAttributes = array()
 

Attributs protégés statiques

static $count = 0
 
static $generated_fieldname = '__field'
 

Description détaillée

Abstract Form Field class for the Joomla Platform.

Depuis
1.7.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $form = null)

Method to instantiate the form field object.

Paramètres
Form$formThe form to attach to the form field object.
Depuis
1.7.0

Références $form, $parts, Normalise\fromCamelCase(), et StringHelper\ucfirst().

Documentation des fonctions membres

◆ __get()

__get (   $name)

Method to get certain otherwise inaccessible properties from the form field object.

Paramètres
string$nameThe property name for which to get the value.
Renvoie
mixed The property value or null.
Depuis
1.7.0

Références $input, $label, $name, et Joomla\Application\getInput().

◆ __set()

__set (   $name,
  $value 
)

Method to set certain otherwise inaccessible properties of the form field object.

Paramètres
string$nameThe property name for which to set the value.
mixed$valueThe value of the property.
Renvoie
void
Depuis
3.2

Références $name, $value, Log\add(), et name.

◆ filter()

filter (   $value,
  $group = null,
Registry  $input = null 
)

Method to filter a field value.

Paramètres
mixed$valueThe optional value to use as the default for the field.
string$groupThe optional dot-separated form group path on which to find the field.
Registry$inputAn optional Registry object with the entire data set to filter against the entire form.
Renvoie
mixed The filtered value.
Depuis
4.0.0
Exceptions

Références $input, $key, $required, $return, $this, $val, $value, InputFilter\getInstance(), FormHelper\loadFilterType(), et null.

◆ getAttribute()

getAttribute (   $name,
  $default = null 
)

Method to get an attribute of the field

Paramètres
string$nameName of the attribute to get
mixed$defaultOptional value to return if attribute not found
Renvoie
mixed Value of the attribute / default
Depuis
3.2

Références $attributes, $default, et null.

◆ getDataAttributes()

getDataAttributes ( )

Method to get data attributes. For example, data-user-type

Renvoie
array list of data attribute(s)
Depuis
4.0.0

◆ getFieldName()

getFieldName (   $fieldName)
protected

Method to get the field name used.

Paramètres
string$fieldNameThe field element name.
Renvoie
string The field name
Depuis
1.7.0

Références $count.

◆ getId()

getId (   $fieldId,
  $fieldName 
)
protected

Method to get the id used for the field input tag.

Paramètres
string$fieldIdThe field element id.
string$fieldNameThe field element name.
Renvoie
string The id to be used for the field input tag.
Depuis
1.7.0

Références $id.

◆ getInput()

getInput ( )
protected

Method to get the field input markup.

Renvoie
string The field input markup.
Depuis
1.7.0

Références name.

◆ getLabel()

getLabel ( )
protected

Method to get the field label markup.

Renvoie
string The field label markup.
Depuis
1.7.0

Références $data, et $position.

◆ getLayoutData()

getLayoutData ( )
protected

Method to get the data to be passed to the layout for rendering.

Renvoie
array
Depuis
3.5

Références $alt, $autocomplete, $autofocus, $class, $description, $disabled, $hint, $id, $label, $name, $onchange, $onclick, $readonly, $this, Text\_(), Text\alt(), description, null, et value.

◆ getLayoutPaths()

getLayoutPaths ( )
protected

Allow to override renderer include paths in child fields

Renvoie
array
Depuis
3.5

Références $renderer.

◆ getName()

getName (   $fieldName)
protected

Method to get the name used for the field input tag.

Paramètres
string$fieldNameThe field element name.
Renvoie
string The name to be used for the field input tag.
Depuis
1.7.0

Références $groups, et $name.

◆ getRenderer()

getRenderer (   $layoutId = 'default')
protected

Get the renderer

Paramètres
string$layoutIdId to load
Renvoie
FileLayout
Depuis
3.5

Références $renderer.

◆ getTitle()

getTitle ( )
protected

Method to get the field title.

Renvoie
string The field title.
Depuis
1.7.0

Références $title, et Text\_().

◆ isDebugEnabled()

isDebugEnabled ( )
protected

Is debug enabled for this field

Renvoie
boolean
Depuis
3.5

◆ postProcess()

postProcess (   $value,
  $group = null,
Registry  $input = null 
)

Method to post-process a field value.

Paramètres
mixed$valueThe optional value to use as the default for the field.
string$groupThe optional dot-separated form group path on which to find the field.
Registry$inputAn optional Registry object with the entire data set to filter against the entire form.
Renvoie
mixed The processed value.
Depuis
4.0.0

Références $value.

◆ render()

render (   $layoutId,
  $data = array() 
)

Render a layout of this field

Paramètres
string$layoutIdLayout identifier
array$dataOptional data for the layout
Renvoie
string
Depuis
3.5

Références $data.

◆ renderDataAttributes()

renderDataAttributes ( )

Method to render data attributes to html.

Renvoie
string A HTML Tag Attribute string of data attribute(s)
Depuis
4.0.0

Références $dataAttribute, $key, et ENT_COMPAT.

◆ renderField()

renderField (   $options = array())

Method to get a control group with label and input.

Paramètres
array$optionsOptions to be passed into the rendering of the field
Renvoie
string A string containing the html for the control group
Depuis
3.2

Références $data, $options, Joomla\Application\getInput(), et FormHelper\parseShowOnConditions().

◆ setForm()

setForm ( Form  $form)

Method to attach a Form object to the field.

Paramètres
Form$formThe Form object to attach to the form field.
Renvoie
FormField The form field object so that the method can be used in a chain.
Depuis
1.7.0

Références $form, et $this.

◆ setup()

setup ( \SimpleXMLElement  $element,
  $value,
  $group = null 
)

Method to attach a Form object to the field.

Paramètres
\SimpleXMLElement$elementThe SimpleXMLElement object representing the <field> tag for the form field object.
mixed$valueThe form field value to validate.
string$groupThe field name group control value. This acts as as an array container for the field. For example if the field has name="foo" and the group value is set to "bar" then the full field name would end up being "bar[foo]".
Renvoie
boolean True on success.
Depuis
1.7.0

Références $attributes, $key, $value, class, null, et value.

Référencé par IntervalField\setup().

◆ setValue()

setValue (   $value)

Simple method to set the value

Paramètres
mixed$valueValue to set
Renvoie
void
Depuis
3.2

Références $value, et value.

◆ validate()

validate (   $value,
  $group = null,
Registry  $input = null 
)

Method to validate a FormField object based on field data.

Paramètres
mixed$valueThe optional value to use as the default for the field.
string$groupThe optional dot-separated form group path on which to find the field.
Registry$inputAn optional Registry object with the entire data set to validate against the entire form.
Renvoie
boolean| Boolean true if field value is valid, Exception on failure.
Depuis
4.0.0
Exceptions

Références $input, $message, $required, $this, $type, $value, Text\_(), class, Factory\getContainer(), Joomla\Database\getDatabase(), FormHelper\loadRuleType(), null, et Text\sprintf().

Documentation des champs

◆ $autocomplete

$autocomplete = 'on'
protected

◆ $autofocus

$autofocus = false
protected

◆ $class

$class
protected

◆ $count

$count = 0
staticprotected

◆ $dataAttributes

$dataAttributes = array()
protected

◆ $default

$default
protected

◆ $description

$description
protected

◆ $disabled

$disabled = false
protected

◆ $element

$element
protected

◆ $fieldname

$fieldname
protected

◆ $form

$form
protected

◆ $formControl

$formControl
protected

◆ $generated_fieldname

$generated_fieldname = '__field'
staticprotected

◆ $group

$group
protected

◆ $hidden

$hidden = false
protected

◆ $hiddenDescription

$hiddenDescription = false
protected

◆ $hiddenLabel

$hiddenLabel = false
protected

◆ $hint

$hint
protected

◆ $id

$id
protected

◆ $input

$input
protected

◆ $label

$label
protected

◆ $labelclass

$labelclass
protected

◆ $layout

$layout
protected

◆ $multiple

$multiple = false
protected

◆ $name

$name
protected

◆ $onchange

$onchange
protected

◆ $onclick

$onclick
protected

◆ $parentclass

$parentclass
protected

◆ $pattern

$pattern
protected

◆ $readonly

$readonly = false
protected

◆ $renderLabelLayout

$renderLabelLayout = 'joomla.form.renderlabel'
protected

◆ $renderLayout

$renderLayout = 'joomla.form.renderfield'
protected

◆ $repeat

$repeat = false

◆ $required

$required = false
protected

◆ $showon

$showon
protected

◆ $size

$size
protected

◆ $spellcheck

$spellcheck = true
protected

◆ $translateDescription

$translateDescription = true
protected

◆ $translateHint

$translateHint = true
protected

◆ $translateLabel

$translateLabel = true
protected

◆ $type

$type
protected

◆ $validate

$validate
protected

◆ $validationtext

$validationtext
protected

◆ $value

$value
protected

La documentation de cette classe a été générée à partir du fichier suivant :