Liste de tous les membres
Fonctions membres publiques |
| __construct ($name, array $options=array()) |
| bind ($data) |
| filter ($data, $group=null) |
| getErrors () |
| getField ($name, $group=null, $value=null) |
| getFieldAttribute ($name, $attribute, $default=null, $group=null) |
| getFieldset ($set=null) |
| getFieldsets ($group=null) |
| getFormControl () |
| getGroup ($group, $nested=false) |
| getInput ($name, $group=null, $value=null) |
| getLabel ($name, $group=null) |
| getName () |
| getValue ($name, $group=null, $default=null) |
| load ($data, $replace=true, $xpath=false) |
| loadFile ($file, $reset=true, $xpath=false) |
| removeField ($name, $group=null) |
| removeGroup ($group) |
| reset ($xml=false) |
| setField (&$element, $group=null, $replace=true) |
| setFieldAttribute ($name, $attribute, $value, $group=null) |
| setFields (&$elements, $group=null, $replace=true) |
| setValue ($name, $group=null, $value=null) |
| validate ($data, $group=null) |
Fonctions membres protégées |
| bindLevel ($group, $data) |
| filterField ($element, $value) |
| findField ($name, $group=null) |
& | findFieldsByFieldset ($name) |
& | findFieldsByGroup ($group=null, $nested=false) |
& | findGroup ($group) |
| loadField ($element, $group=null, $value=null) |
| loadFieldType ($type, $new=true) |
| loadRuleType ($type, $new=true) |
| syncPaths () |
| validateField ($element, $group=null, $value=null, $input=null) |
Fonctions membres protégées statiques |
static | addNode (SimpleXMLElement $source, SimpleXMLElement $new) |
static | mergeNode (SimpleXMLElement $source, SimpleXMLElement $new) |
static | mergeNodes (SimpleXMLElement $source, SimpleXMLElement $new) |
Attributs protégés statiques |
static | $forms = array() |
Documentation des constructeurs et destructeur
JForm::__construct |
( |
|
$name, |
|
|
array |
$options = array() |
|
) |
| |
Method to instantiate the form object.
- Paramètres:
-
string | $name | The name of the form. |
array | $options | An array of form options. |
- Depuis:
- 11.1
Références $name, et $options.
Documentation des fonctions membres
static JForm::addFieldPath |
( |
|
$new = null | ) |
|
|
static |
static JForm::addFormPath |
( |
|
$new = null | ) |
|
|
static |
static JForm::addNode |
( |
SimpleXMLElement |
$source, |
|
|
SimpleXMLElement |
$new |
|
) |
| |
|
staticprotected |
Adds a new child SimpleXMLElement node to the source.
- Paramètres:
-
SimpleXMLElement | $source | The source element on which to append. |
SimpleXMLElement | $new | The new element to append. |
- Renvoie:
- void
- Depuis:
- 11.1
- Exceptions:
-
Exception | if an error occurs. |
Références $name.
static JForm::addRulePath |
( |
|
$new = null | ) |
|
|
static |
Method to bind data to the form.
- Paramètres:
-
mixed | $data | An array or object of data to bind to the form. |
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
Références $data, elseif, et JArrayHelper\isAssociative().
JForm::bindLevel |
( |
|
$group, |
|
|
|
$data |
|
) |
| |
|
protected |
Method to bind data to the form for the group level.
- Paramètres:
-
string | $group | The dot-separated form group path on which to bind the data. |
mixed | $data | An array or object of data to bind to the form for the group level. |
- Renvoie:
- void
- Depuis:
- 11.1
Références $data, elseif, et JArrayHelper\isAssociative().
JForm::filter |
( |
|
$data, |
|
|
|
$group = null |
|
) |
| |
Method to filter the form data.
- Paramètres:
-
array | $data | An array of field values to filter. |
string | $group | The dot-separated form group path on which to filter the fields. |
- Renvoie:
- mixed Array or false.
- Depuis:
- 11.1
Références $data, $field, $fields, $name, et $output.
JForm::filterField |
( |
|
$element, |
|
|
|
$value |
|
) |
| |
|
protected |
Method to apply an input filter to a value based on field data.
- Paramètres:
-
string | $element | The XML element object representation of the form field. |
mixed | $value | The value to filter for the field. |
- Renvoie:
- mixed The filtered value.
- Depuis:
- 11.1
Références $id, $return, elseif, JFactory\getConfig(), JFactory\getDate(), JFilterInput\getInstance(), JURI\getInstance(), JFactory\getUser(), null, JURI\root(), et JArrayHelper\toInteger().
JForm::findField |
( |
|
$name, |
|
|
|
$group = null |
|
) |
| |
|
protected |
Method to get a form field represented as an XML element object.
- Paramètres:
-
string | $name | The name of the form field. |
string | $group | The optional dot-separated form group path on which to find the field. |
- Renvoie:
- mixed The XML element object for the field or boolean false on error.
- Depuis:
- 11.1
Références $field, $fields, $name, et $names.
& JForm::findFieldsByFieldset |
( |
|
$name | ) |
|
|
protected |
Method to get an array of <field> elements from the form XML document which are in a specified fieldset by name.
- Paramètres:
-
string | $name | The name of the fieldset. |
- Renvoie:
- mixed Boolean false on error or array of SimpleXMLElement objects.
- Depuis:
- 11.1
Références $fields, et $name.
& JForm::findFieldsByGroup |
( |
|
$group = null , |
|
|
|
$nested = false |
|
) |
| |
|
protected |
Method to get an array of <field> elements from the form XML document which are in a control group by name.
- Paramètres:
-
mixed | $group | The optional dot-separated form group path on which to find the fields. Null will return all fields. False will return fields not in a group. |
boolean | $nested | True to also include fields in nested groups that are inside of the group for which to find fields. |
- Renvoie:
- mixed Boolean false on error or array of SimpleXMLElement objects.
- Depuis:
- 11.1
Références $field, $fields, $names, et elseif.
& JForm::findGroup |
( |
|
$group | ) |
|
|
protected |
Method to get a form field group represented as an XML element object.
- Paramètres:
-
string | $group | The dot-separated form group path on which to find the group. |
- Renvoie:
- mixed An array of XML element objects for the group or boolean false on error.
- Depuis:
- 11.1
Références $fields, $i, $n, et $names.
Return all errors, if any.
- Renvoie:
- array Array of error messages or JException objects.
- Depuis:
- 11.1
JForm::getField |
( |
|
$name, |
|
|
|
$group = null , |
|
|
|
$value = null |
|
) |
| |
Method to get a form field represented as a JFormField object.
- Paramètres:
-
string | $name | The name of the form field. |
string | $group | The optional dot-separated form group path on which to find the field. |
mixed | $value | The optional value to use as the default for the field. |
- Renvoie:
- mixed The JFormField object for the field or boolean false on error.
- Depuis:
- 11.1
Références $name.
JForm::getFieldAttribute |
( |
|
$name, |
|
|
|
$attribute, |
|
|
|
$default = null , |
|
|
|
$group = null |
|
) |
| |
Method to get an attribute value from a field XML element. If the attribute doesn't exist or is null then the optional default value will be used.
- Paramètres:
-
string | $name | The name of the form field for which to get the attribute value. |
string | $attribute | The name of the attribute for which to get a value. |
mixed | $default | The optional default value to use if no attribute value exists. |
string | $group | The optional dot-separated form group path on which to find the field. |
- Renvoie:
- mixed The attribute value for the field.
- Depuis:
- 11.1
Références $name.
JForm::getFieldset |
( |
|
$set = null | ) |
|
Method to get an array of JFormField objects in a given fieldset by name. If no name is given then all fields are returned.
- Paramètres:
-
string | $set | The optional name of the fieldset. |
- Renvoie:
- array The array of JFormField objects in the fieldset.
- Depuis:
- 11.1
Références $field, et $fields.
JForm::getFieldsets |
( |
|
$group = null | ) |
|
Method to get an array of fieldset objects optionally filtered over a given field group.
- Paramètres:
-
string | $group | The dot-separated form group path on which to filter the fieldsets. |
- Renvoie:
- array The array of fieldset objects.
- Depuis:
- 11.1
Références $fieldsets, et $name.
JForm::getFormControl |
( |
| ) |
|
Method to get the form control. This string serves as a container for all form fields. For example, if there is a field named 'foo' and a field named 'bar' and the form control is empty the fields will be rendered like: <input name="foo"> and <input name="bar">. If the form control is set to 'joomla' however, the fields would be rendered like: <input name="joomla[foo]"> and <input name="joomla[bar]">.
- Renvoie:
- string The form control string.
- Depuis:
- 11.1
Référencé par JFormField\setForm().
JForm::getGroup |
( |
|
$group, |
|
|
|
$nested = false |
|
) |
| |
Method to get an array of JFormField objects in a given field group by name.
- Paramètres:
-
string | $group | The dot-separated form group path for which to get the form fields. |
boolean | $nested | True to also include fields in nested groups that are inside of the group for which to find fields. |
- Renvoie:
- array The array of JFormField objects in the field group.
- Depuis:
- 11.1
Références $field, et $fields.
JForm::getInput |
( |
|
$name, |
|
|
|
$group = null , |
|
|
|
$value = null |
|
) |
| |
Method to get a form field markup for the field input.
- Paramètres:
-
string | $name | The name of the form field. |
string | $group | The optional dot-separated form group path on which to find the field. |
mixed | $value | The optional value to use as the default for the field. |
- Renvoie:
- string The form field markup.
- Depuis:
- 11.1
Références $field, et $name.
static JForm::getInstance |
( |
|
$name, |
|
|
|
$data = null , |
|
|
|
$options = array() , |
|
|
|
$replace = true , |
|
|
|
$xpath = false |
|
) |
| |
|
static |
Method to get an instance of a form.
- Paramètres:
-
string | $name | The name of the form. |
string | $data | The name of an XML file or string to load as the form definition. |
array | $options | An array of form options. |
string | $replace | Flag to toggle whether form fields should be replaced if a field already exists with the same group/name. |
string | $xpath | An optional xpath to search for the fields. |
- Renvoie:
- object JForm instance.
- Depuis:
- 11.1
- Exceptions:
-
Exception | if an error occurs. |
Références $data, $name, $options, et JText\_().
Référencé par JInstallationModelSetup\getForm(), InstallerModelManage\getForm(), et JModelForm\loadForm().
JForm::getLabel |
( |
|
$name, |
|
|
|
$group = null |
|
) |
| |
Method to get the label for a field input.
- Paramètres:
-
string | $name | The name of the form field. |
string | $group | The optional dot-separated form group path on which to find the field. |
- Renvoie:
- string The form field label.
- Depuis:
- 11.1
Références $field, et $name.
Method to get the form name.
- Renvoie:
- string The name of the form.
- Depuis:
- 11.1
Références $name.
JForm::getValue |
( |
|
$name, |
|
|
|
$group = null , |
|
|
|
$default = null |
|
) |
| |
Method to get the value of a field.
- Paramètres:
-
string | $name | The name of the field for which to get the value. |
string | $group | The optional dot-separated form group path on which to get the value. |
mixed | $default | The optional default value of the field value is empty. |
- Renvoie:
- mixed The value of the field or the default value if empty.
- Depuis:
- 11.1
Références $name, et $return.
JForm::load |
( |
|
$data, |
|
|
|
$replace = true , |
|
|
|
$xpath = false |
|
) |
| |
Method to load the form description from an XML string or object.
The replace option works per field. If a field being loaded already exists in the current form definition then the behavior or load will vary depending upon the replace flag. If it is set to true, then the existing field will be replaced in its exact location by the new field being loaded. If it is false, then the new field being loaded will be ignored and the method will move on to the next field to load.
- Paramètres:
-
string | $data | The name of an XML string or object. |
string | $replace | Flag to toggle whether form fields should be replaced if a field already exists with the same group/name. |
string | $xpath | An optional xpath to search for the fields. |
- Renvoie:
- boolean True on success, false otherwise.
- Depuis:
- 11.1
Références $data, $field, $fields, elseif, et JFactory\getXML().
Référencé par MenusModelItem\preprocessForm().
JForm::loadField |
( |
|
$element, |
|
|
|
$group = null , |
|
|
|
$value = null |
|
) |
| |
|
protected |
Method to load, setup and return a JFormField object based on field data.
- Paramètres:
-
string | $element | The XML element object representation of the form field. |
string | $group | The optional dot-separated form group path on which to find the field. |
mixed | $value | The optional value to use as the default for the field. |
- Renvoie:
- mixed The JFormField object for the field or boolean false on error.
- Depuis:
- 11.1
Références $field, $lang, $type, JText\_(), JFactory\getLanguage(), et null.
JForm::loadFieldType |
( |
|
$type, |
|
|
|
$new = true |
|
) |
| |
|
protected |
JForm::loadFile |
( |
|
$file, |
|
|
|
$reset = true , |
|
|
|
$xpath = false |
|
) |
| |
JForm::loadRuleType |
( |
|
$type, |
|
|
|
$new = true |
|
) |
| |
|
protected |
static JForm::mergeNode |
( |
SimpleXMLElement |
$source, |
|
|
SimpleXMLElement |
$new |
|
) |
| |
|
staticprotected |
Adds a new child SimpleXMLElement node to the source.
- Paramètres:
-
SimpleXMLElement | $source | The source element on which to append. |
SimpleXMLElement | $new | The new element to append. |
- Renvoie:
- void
- Depuis:
- 11.1
Références $name.
static JForm::mergeNodes |
( |
SimpleXMLElement |
$source, |
|
|
SimpleXMLElement |
$new |
|
) |
| |
|
staticprotected |
Merges new elements into a source <fields> element.
- Paramètres:
-
SimpleXMLElement | $source | The source element. |
SimpleXMLElement | $new | The new element to merge. |
- Renvoie:
- void
- Depuis:
- 11.1
Références $fields, $name, et $type.
JForm::removeField |
( |
|
$name, |
|
|
|
$group = null |
|
) |
| |
Method to remove a field from the form definition.
- Paramètres:
-
string | $name | The name of the form field for which remove. |
string | $group | The optional dot-separated form group path on which to find the field. |
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
Références $name.
JForm::removeGroup |
( |
|
$group | ) |
|
Method to remove a group from the form definition.
- Paramètres:
-
string | $group | The dot-separated form group path for the group to remove. |
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
JForm::reset |
( |
|
$xml = false | ) |
|
Method to reset the form data store and optionally the form XML definition.
- Paramètres:
-
boolean | $xml | True to also reset the XML form definition. |
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
JForm::setField |
( |
& |
$element, |
|
|
|
$group = null , |
|
|
|
$replace = true |
|
) |
| |
Method to set a field XML element to the form definition. If the replace flag is set then the field will be set whether it already exists or not. If it isn't set, then the field will not be replaced if it already exists.
- Paramètres:
-
object | &$element | The XML element object representation of the form field. |
string | $group | The optional dot-separated form group path on which to set the field. |
boolean | $replace | True to replace an existing field if one already exists. |
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
Références $fields.
JForm::setFieldAttribute |
( |
|
$name, |
|
|
|
$attribute, |
|
|
|
$value, |
|
|
|
$group = null |
|
) |
| |
JForm::setFields |
( |
& |
$elements, |
|
|
|
$group = null , |
|
|
|
$replace = true |
|
) |
| |
Method to set some field XML elements to the form definition. If the replace flag is set then the fields will be set whether they already exists or not. If it isn't set, then the fields will not be replaced if they already exist.
- Paramètres:
-
object | &$elements | The array of XML element object representations of the form fields. |
string | $group | The optional dot-separated form group path on which to set the fields. |
boolean | $replace | True to replace existing fields if they already exist. |
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
Références $return.
JForm::setValue |
( |
|
$name, |
|
|
|
$group = null , |
|
|
|
$value = null |
|
) |
| |
Method to set the value of a field. If the field does not exist in the form then the method will return false.
- Paramètres:
-
string | $name | The name of the field for which to set the value. |
string | $group | The optional dot-separated form group path on which to find the field. |
mixed | $value | The value to set for the field. |
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
Références $name.
Method to synchronize any field, form or rule paths contained in the XML document.
- Renvoie:
- boolean True on success.
- Depuis:
- 11.1
Références $path, et JPATH_ROOT.
JForm::validate |
( |
|
$data, |
|
|
|
$group = null |
|
) |
| |
Method to validate form data.
Validation warnings will be pushed into JForm::errors and should be retrieved with JForm::getErrors() when validate returns boolean false.
- Paramètres:
-
array | $data | An array of field values to validate. |
string | $group | The optional dot-separated form group path on which to filter the fields to be validated. |
- Renvoie:
- mixed True on sucess.
- Depuis:
- 11.1
Références $data, $field, $fields, $name, $return, null, et JError\raiseWarning().
JForm::validateField |
( |
|
$element, |
|
|
|
$group = null , |
|
|
|
$value = null , |
|
|
|
$input = null |
|
) |
| |
|
protected |
Method to validate a JFormField object based on field data.
- Paramètres:
-
string | $element | The XML element object representation of the form field. |
string | $group | The optional dot-separated form group path on which to find the field. |
mixed | $value | The optional value to use as the default for the field. |
object | $input | An optional JRegistry object with the entire data set to validate against the entire form. |
- Renvoie:
- mixed Boolean true if field value is valid, JException on failure.
- Depuis:
- 11.1
Références $message, $type, JText\_(), null, et JText\sprintf().
Documentation des données membres
JForm::$options = array() |
|
protected |
La documentation de cette classe a été générée à partir du fichier suivant :