Proxy for JFormHelper::addFieldPath().
static array
addFieldPath
([mixed $new = null])
-
mixed
$new: A path or array of paths to add.
Redefined in descendants as:
Proxy for JFormHelper::addFormPath().
static array
addFormPath
([mixed $new = null])
-
mixed
$new: A path or array of paths to add.
Redefined in descendants as:
Adds a new child SimpleXMLElement node to the source.
static void
addNode
(SimpleXMLElement $source, SimpleXMLElement $new)
-
SimpleXMLElement
$source: The source element on which to append.
-
SimpleXMLElement
$new: The new element to append.
Proxy for JFormHelper::addRulePath().
static array
addRulePath
([mixed $new = null])
-
mixed
$new: A path or array of paths to add.
Redefined in descendants as:
Method to get an instance of a form.
static
object JForm
getInstance
(
string $name, [
string $data =
null], [
array $options =
array()], [
string $replace =
true], [
string $xpath =
false])
-
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.
Redefined in descendants as:
Update the attributes of a child node
static void
mergeNode
(SimpleXMLElement $source, SimpleXMLElement $new)
-
SimpleXMLElement
$source: The source element on which to append the attributes
-
SimpleXMLElement
$new: The new element to append
Merges new elements into a source <fields> element.
static void
mergeNodes
(SimpleXMLElement $source, SimpleXMLElement $new)
-
SimpleXMLElement
$source: The source element.
-
SimpleXMLElement
$new: The new element to merge.
Method to instantiate the form object.
JForm
__construct
(string $name, [array $options = array()])
-
string
$name: The name of the form.
-
array
$options: An array of form options.
Method to bind data to the form.
boolean
bind
(mixed $data)
-
mixed
$data: An array or object of data to bind to the form.
Method to bind data to the form for the group level.
void
bindLevel
(string $group, mixed $data)
-
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.
Method to filter the form data.
mixed
filter
(array $data, [string $group = null])
-
array
$data: An array of field values to filter.
-
string
$group: The dot-separated form group path on which to filter the fields.
Method to apply an input filter to a value based on field data.
mixed
filterField
(string $element, mixed $value)
-
string
$element: The XML element object representation of the form field.
-
mixed
$value: The value to filter for the field.
Method to get a form field represented as an XML element object.
mixed
findField
(string $name, [string $group = null])
-
string
$name: The name of the form field.
-
string
$group: The optional dot-separated form group path on which to find the field.
Method to get an array of <field /> elements from the form XML document which are in a specified fieldset by name.
mixed
&findFieldsByFieldset
(string $name)
-
string
$name: The name of the fieldset.
Method to get an array of <field /> elements from the form XML document which are in a control group by name.
mixed
&findFieldsByGroup
([mixed $group = null], [boolean $nested = false])
-
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.
Method to get a form field group represented as an XML element object.
mixed
&findGroup
(string $group)
-
string
$group: The dot-separated form group path on which to find the group.
Returns the value of an attribute of the form itself
mixed
getAttribute
(string $name, [mixed $default = null])
-
string
$name: Name of the attribute to get
-
mixed
$default: Optional value to return if attribute not found
Redefined in descendants as:
Method to get a control group with label and input.
string
getControlGroup
(string $name, [string $group = null], [mixed $default = null])
-
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.
Method to get all control groups with label and input of a fieldset.
string
getControlGroups
(string $name)
-
string
$name: The name of the fieldset for which to get the values.
Getter for the form data
Redefined in descendants as:
-
FOFForm::getData()
: Returns a reference to the protected $data object, allowing direct access to and manipulation of the form's data.
Return all errors, if any.
array
getErrors
()
Method to get a form field represented as a JFormField object.
mixed
getField
(string $name, [string $group = null], [mixed $value = null])
-
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.
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.
mixed
getFieldAttribute
(string $name, string $attribute, [mixed $default = null], [string $group = null])
-
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.
Method to get an array of JFormField objects in a given fieldset by name. If no name is given then all fields are returned.
array
getFieldset
([string $set = null])
-
string
$set: The optional name of the fieldset.
Method to get an array of fieldset objects optionally filtered over a given field group.
array
getFieldsets
([string $group = null])
-
string
$group: The dot-separated form group path on which to filter the fieldsets.
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]" />.
string
getFormControl
()
Method to get an array of JFormField objects in a given field group by name.
array
getGroup
(string $group, [boolean $nested = false])
-
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.
Method to get a form field markup for the field input.
string
getInput
(string $name, [string $group = null], [mixed $value = null])
-
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.
Method to get the label for a field input.
string
getLabel
(string $name, [string $group = null])
-
string
$name: The name of the form field.
-
string
$group: The optional dot-separated form group path on which to find the field.
Method to get the form name.
string
getName
()
Method to get the value of a field.
mixed
getValue
(string $name, [string $group = null], [mixed $default = null])
-
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.
Method to get the XML form object
SimpleXMLElement
getXml
()
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.
boolean
load
(string $data, [string $replace = true], [string $xpath = false])
-
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.
Method to load, setup and return a JFormField object based on field data.
mixed
loadField
(string $element, [string $group = null], [mixed $value = null])
-
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.
Proxy for JFormHelper::loadFieldType().
mixed
loadFieldType
(string $type, [boolean $new = true])
-
string
$type: The field type.
-
boolean
$new: Flag to toggle whether we should get a new instance of the object.
Redefined in descendants as:
Method to load the form description from an XML file.
The reset option works on a group basis. If the XML file references groups that have already been created they will be replaced with the fields in the new XML file unless the $reset parameter has been set to false.
boolean
loadFile
(string $file, [string $reset = true], [string $xpath = false])
-
string
$file: The filesystem path of an XML file.
-
string
$reset: 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.
Proxy for JFormHelper::loadRuleType().
mixed
loadRuleType
(string $type, [boolean $new = true])
-
string
$type: The rule type.
-
boolean
$new: Flag to toggle whether we should get a new instance of the object.
Redefined in descendants as:
Method to remove a field from the form definition.
boolean
removeField
(string $name, [string $group = null])
-
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.
Method to remove a group from the form definition.
boolean
removeGroup
(string $group)
-
string
$group: The dot-separated form group path for the group to remove.
Method to reset the form data store and optionally the form XML definition.
boolean
reset
([boolean $xml = false])
-
boolean
$xml: True to also reset the XML form definition.
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.
boolean
setField
(SimpleXMLElement $element, [string $group = null], [boolean $replace = true])
-
SimpleXMLElement
$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.
Method to set an attribute value for a field XML element.
boolean
setFieldAttribute
(string $name, string $attribute, mixed $value, [string $group = null])
-
string
$name: The name of the form field for which to set the attribute value.
-
string
$attribute: The name of the attribute for which to set a value.
-
mixed
$value: The value to set for the attribute.
-
string
$group: The optional dot-separated form group path on which to find the field.
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.
boolean
setFields
(array &$elements, [string $group = null], [boolean $replace = true])
-
array
&$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.
Method to set the value of a field. If the field does not exist in the form then the method will return false.
boolean
setValue
(string $name, [string $group = null], [mixed $value = null])
-
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.
Method to synchronize any field, form or rule paths contained in the XML document.
boolean
syncPaths
()
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.
mixed
validate
(array $data, [string $group = null])
-
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.
Method to validate a JFormField object based on field data.
mixed
validateField
(
SimpleXMLElement $element, [
string $group =
null], [
mixed $value =
null], [
JRegistry $input =
null])
-
SimpleXMLElement
$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.
-
JRegistry
$input: An optional JRegistry object with the entire data set to validate against the entire form.