Actions

API17

Difference between revisions of "JForm"

From Joomla! Documentation

(Layout updates)
(Updated to r1448:247ba8d88526)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
=={{JVer|11.1}} JForm==
 +
===Description===
 +
{{Description:JForm}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[Description:JForm|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JForm|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
{{Description:JForm}}
 
===Defined in===
 
libraries/joomla/form/form.php
 
* see source code in [[jplatform:form/form.php|BitBucket]]
 
===Subpackage===
 
[[Subpackage Form/11.1|Form]]
 
===Extends===
 
===Extended by===
 
 
===Methods===
 
===Methods===
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
 +
!Visibility
 
!Method name
 
!Method name
 
!Description
 
!Description
 
|-
 
|-
 +
|public
 
|[[JForm::__construct/11.1|__construct]]
 
|[[JForm::__construct/11.1|__construct]]
 
|Method to instantiate the form object.  
 
|Method to instantiate the form object.  
 
|-
 
|-
 +
|public
 
|[[JForm::bind/11.1|bind]]
 
|[[JForm::bind/11.1|bind]]
 
|Method to bind data to the form.  
 
|Method to bind data to the form.  
 
|-
 
|-
 +
|public
 
|[[JForm::filter/11.1|filter]]
 
|[[JForm::filter/11.1|filter]]
 
|Method to filter the form data.  
 
|Method to filter the form data.  
 
|-
 
|-
 +
|public
 
|[[JForm::getErrors/11.1|getErrors]]
 
|[[JForm::getErrors/11.1|getErrors]]
 
|Return all errors, if any.  
 
|Return all errors, if any.  
 
|-
 
|-
 +
|public
 
|[[JForm::getField/11.1|getField]]
 
|[[JForm::getField/11.1|getField]]
 
|Method to get a form field represented as a  object.  
 
|Method to get a form field represented as a  object.  
 
|-
 
|-
 +
|public
 
|[[JForm::getFieldAttribute/11.1|getFieldAttribute]]
 
|[[JForm::getFieldAttribute/11.1|getFieldAttribute]]
 
|Method to get an attribute value from a field XML element.  
 
|Method to get an attribute value from a field XML element.  
 
|-
 
|-
 +
|public
 
|[[JForm::getFieldset/11.1|getFieldset]]
 
|[[JForm::getFieldset/11.1|getFieldset]]
 
|Method to get an array of  objects in a given fieldset by name.  
 
|Method to get an array of  objects in a given fieldset by name.  
 
|-
 
|-
 +
|public
 
|[[JForm::getFieldsets/11.1|getFieldsets]]
 
|[[JForm::getFieldsets/11.1|getFieldsets]]
 
|Method to get an array of fieldset objects optionally filtered over a given field group.  
 
|Method to get an array of fieldset objects optionally filtered over a given field group.  
 
|-
 
|-
 +
|public
 
|[[JForm::getFormControl/11.1|getFormControl]]
 
|[[JForm::getFormControl/11.1|getFormControl]]
 
|Method to get the form control.  
 
|Method to get the form control.  
 
|-
 
|-
 +
|public
 
|[[JForm::getGroup/11.1|getGroup]]
 
|[[JForm::getGroup/11.1|getGroup]]
 
|Method to get an array of  objects in a given field group by name.  
 
|Method to get an array of  objects in a given field group by name.  
 
|-
 
|-
 +
|public
 
|[[JForm::getInput/11.1|getInput]]
 
|[[JForm::getInput/11.1|getInput]]
 
|Method to get a form field markup for the field input.  
 
|Method to get a form field markup for the field input.  
 
|-
 
|-
 +
|public
 
|[[JForm::getLabel/11.1|getLabel]]
 
|[[JForm::getLabel/11.1|getLabel]]
 
|Method to get a form field markup for the field input.  
 
|Method to get a form field markup for the field input.  
 
|-
 
|-
 +
|public
 
|[[JForm::getName/11.1|getName]]
 
|[[JForm::getName/11.1|getName]]
 
|Method to get the form name.  
 
|Method to get the form name.  
 
|-
 
|-
 +
|public
 
|[[JForm::getValue/11.1|getValue]]
 
|[[JForm::getValue/11.1|getValue]]
 
|Method to get the value of a field.  
 
|Method to get the value of a field.  
 
|-
 
|-
 +
|public
 
|[[JForm::load/11.1|load]]
 
|[[JForm::load/11.1|load]]
 
|Method to load the form description from an XML string or object.  
 
|Method to load the form description from an XML string or object.  
 
|-
 
|-
 +
|public
 
|[[JForm::loadFile/11.1|loadFile]]
 
|[[JForm::loadFile/11.1|loadFile]]
 
|Method to load the form description from an XML file.  
 
|Method to load the form description from an XML file.  
 
|-
 
|-
 +
|public
 
|[[JForm::removeField/11.1|removeField]]
 
|[[JForm::removeField/11.1|removeField]]
 
|Method to remove a field from the form definition.  
 
|Method to remove a field from the form definition.  
 
|-
 
|-
 +
|public
 
|[[JForm::removeGroup/11.1|removeGroup]]
 
|[[JForm::removeGroup/11.1|removeGroup]]
 
|Method to remove a group from the form definition.  
 
|Method to remove a group from the form definition.  
 
|-
 
|-
 +
|public
 
|[[JForm::reset/11.1|reset]]
 
|[[JForm::reset/11.1|reset]]
 
|Method to reset the form data store and optionally the form XML definition.  
 
|Method to reset the form data store and optionally the form XML definition.  
 
|-
 
|-
 +
|public
 
|[[JForm::setField/11.1|setField]]
 
|[[JForm::setField/11.1|setField]]
 
|Method to set a field XML element to the form definition.  
 
|Method to set a field XML element to the form definition.  
 
|-
 
|-
 +
|public
 
|[[JForm::setFieldAttribute/11.1|setFieldAttribute]]
 
|[[JForm::setFieldAttribute/11.1|setFieldAttribute]]
 
|Method to set an attribute value for a field XML element.  
 
|Method to set an attribute value for a field XML element.  
 
|-
 
|-
 +
|public
 
|[[JForm::setFields/11.1|setFields]]
 
|[[JForm::setFields/11.1|setFields]]
 
|Method to set some field XML elements to the form definition.  
 
|Method to set some field XML elements to the form definition.  
 
|-
 
|-
 +
|public
 
|[[JForm::setValue/11.1|setValue]]
 
|[[JForm::setValue/11.1|setValue]]
 
|Method to set the value of a field.  
 
|Method to set the value of a field.  
 
|-
 
|-
 +
|public
 
|[[JForm::validate/11.1|validate]]
 
|[[JForm::validate/11.1|validate]]
 
|Method to validate form data.  
 
|Method to validate form data.  
 
|-
 
|-
 +
|public static
 
|[[JForm::addFieldPath/11.1|addFieldPath]]
 
|[[JForm::addFieldPath/11.1|addFieldPath]]
 
|Proxy for .  
 
|Proxy for .  
 
|-
 
|-
 +
|public static
 
|[[JForm::addFormPath/11.1|addFormPath]]
 
|[[JForm::addFormPath/11.1|addFormPath]]
 
|Proxy for .  
 
|Proxy for .  
 
|-
 
|-
 +
|public static
 
|[[JForm::addRulePath/11.1|addRulePath]]
 
|[[JForm::addRulePath/11.1|addRulePath]]
 
|Proxy for .  
 
|Proxy for .  
 
|-
 
|-
 +
|public static
 
|[[JForm::getInstance/11.1|getInstance]]
 
|[[JForm::getInstance/11.1|getInstance]]
 
|Method to get an instance of a form.  
 
|Method to get an instance of a form.  
 
|-
 
|-
 +
|protected
 
|[[JForm::bindLevel/11.1|bindLevel]]
 
|[[JForm::bindLevel/11.1|bindLevel]]
 
|Method to bind data to the form for the group level.  
 
|Method to bind data to the form for the group level.  
 
|-
 
|-
 +
|protected
 
|[[JForm::filterField/11.1|filterField]]
 
|[[JForm::filterField/11.1|filterField]]
 
|Method to apply an input filter to a value based on field data.  
 
|Method to apply an input filter to a value based on field data.  
 
|-
 
|-
 +
|protected
 
|[[JForm::findField/11.1|findField]]
 
|[[JForm::findField/11.1|findField]]
 
|Method to get a form field represented as an XML element object.  
 
|Method to get a form field represented as an XML element object.  
 
|-
 
|-
 +
|protected 
 
|[[JForm::findFieldsByFieldset/11.1|findFieldsByFieldset]]
 
|[[JForm::findFieldsByFieldset/11.1|findFieldsByFieldset]]
 
|Method to get an array of <field> elements from the form XML document which are in a specified fieldset by name.  
 
|Method to get an array of <field> elements from the form XML document which are in a specified fieldset by name.  
 
|-
 
|-
 +
|protected 
 
|[[JForm::findFieldsByGroup/11.1|findFieldsByGroup]]
 
|[[JForm::findFieldsByGroup/11.1|findFieldsByGroup]]
 
|Method to get an array of <field> elements from the form XML document which are in a control group by name.  
 
|Method to get an array of <field> elements from the form XML document which are in a control group by name.  
 
|-
 
|-
 +
|protected 
 
|[[JForm::findGroup/11.1|findGroup]]
 
|[[JForm::findGroup/11.1|findGroup]]
 
|Method to get a form field group represented as an XML element object.  
 
|Method to get a form field group represented as an XML element object.  
 
|-
 
|-
 +
|protected
 
|[[JForm::loadField/11.1|loadField]]
 
|[[JForm::loadField/11.1|loadField]]
 
|Method to load, setup and return a  object based on field data.  
 
|Method to load, setup and return a  object based on field data.  
 
|-
 
|-
 +
|protected
 
|[[JForm::loadFieldType/11.1|loadFieldType]]
 
|[[JForm::loadFieldType/11.1|loadFieldType]]
 
|Proxy for .  
 
|Proxy for .  
 
|-
 
|-
 +
|protected
 
|[[JForm::loadRuleType/11.1|loadRuleType]]
 
|[[JForm::loadRuleType/11.1|loadRuleType]]
 
|Proxy for .  
 
|Proxy for .  
 
|-
 
|-
 +
|protected
 
|[[JForm::syncPaths/11.1|syncPaths]]
 
|[[JForm::syncPaths/11.1|syncPaths]]
 
|Method to synchronize any field, form or rule paths contained in the XML document.  
 
|Method to synchronize any field, form or rule paths contained in the XML document.  
 
|-
 
|-
 +
|protected
 
|[[JForm::validateField/11.1|validateField]]
 
|[[JForm::validateField/11.1|validateField]]
 
|Method to validate a  object based on field data.  
 
|Method to validate a  object based on field data.  
 
|-
 
|-
 +
|protected static
 
|[[JForm::addNode/11.1|addNode]]
 
|[[JForm::addNode/11.1|addNode]]
 
|Adds a new child SimpleXMLElement node to the source.  
 
|Adds a new child SimpleXMLElement node to the source.  
 
|-
 
|-
 +
|protected static
 
|[[JForm::mergeNode/11.1|mergeNode]]
 
|[[JForm::mergeNode/11.1|mergeNode]]
 
|
 
|
 
|-
 
|-
 +
|protected static
 
|[[JForm::mergeNodes/11.1|mergeNodes]]
 
|[[JForm::mergeNodes/11.1|mergeNodes]]
 
|Merges new elements into a source <fields> element.  
 
|Merges new elements into a source <fields> element.  
 
|-
 
|-
 
|}
 
|}
 +
* '''Defined in''' libraries/joomla/form/form.php
 
===Importing===
 
===Importing===
 
<source lang="php">jimport( 'joomla.form.form' );</source>
 
<source lang="php">jimport( 'joomla.form.form' );</source>
 
===See also===
 
===See also===
* JForm source code in [[jplatform:form/form.php|BitBucket]]
+
* {{JVer|11.1}} '''JForm source code''' on [[jplatform:form/form.php|BitBucket]]
* [[JForm|Other versions of this class]]
+
* {{JVer|11.1}} Subpackage [[Subpackage Form/11.1|Form]]
 +
* [[JForm|Other versions of JForm]]
 
{{SeeAlso:JForm}}
 
{{SeeAlso:JForm}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JForm|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JForm|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
===Examples===
+
===User contributed notes===
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 161: Line 201:
 
category=ClassExample
 
category=ClassExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JForm]]</noinclude>
 
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JForm]]</noinclude>

Revision as of 18:01, 27 April 2011

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Joomla 11.1 JForm

Description

Description:JForm [Edit Descripton]

Methods

Visibility Method name Description
public __construct Method to instantiate the form object.
public bind Method to bind data to the form.
public filter Method to filter the form data.
public getErrors Return all errors, if any.
public getField Method to get a form field represented as a object.
public getFieldAttribute Method to get an attribute value from a field XML element.
public getFieldset Method to get an array of objects in a given fieldset by name.
public getFieldsets Method to get an array of fieldset objects optionally filtered over a given field group.
public getFormControl Method to get the form control.
public getGroup Method to get an array of objects in a given field group by name.
public getInput Method to get a form field markup for the field input.
public getLabel Method to get a form field markup for the field input.
public getName Method to get the form name.
public getValue Method to get the value of a field.
public load Method to load the form description from an XML string or object.
public loadFile Method to load the form description from an XML file.
public removeField Method to remove a field from the form definition.
public removeGroup Method to remove a group from the form definition.
public reset Method to reset the form data store and optionally the form XML definition.
public setField Method to set a field XML element to the form definition.
public setFieldAttribute Method to set an attribute value for a field XML element.
public setFields Method to set some field XML elements to the form definition.
public setValue Method to set the value of a field.
public validate Method to validate form data.
public static addFieldPath Proxy for .
public static addFormPath Proxy for .
public static addRulePath Proxy for .
public static getInstance Method to get an instance of a form.
protected bindLevel Method to bind data to the form for the group level.
protected filterField Method to apply an input filter to a value based on field data.
protected findField Method to get a form field represented as an XML element object.
protected findFieldsByFieldset Method to get an array of <field> elements from the form XML document which are in a specified fieldset by name.
protected findFieldsByGroup Method to get an array of <field> elements from the form XML document which are in a control group by name.
protected findGroup Method to get a form field group represented as an XML element object.
protected loadField Method to load, setup and return a object based on field data.
protected loadFieldType Proxy for .
protected loadRuleType Proxy for .
protected syncPaths Method to synchronize any field, form or rule paths contained in the XML document.
protected validateField Method to validate a object based on field data.
protected static addNode Adds a new child SimpleXMLElement node to the source.
protected static mergeNode
protected static mergeNodes Merges new elements into a source <fields> element.
  • Defined in libraries/joomla/form/form.php

Importing

jimport( 'joomla.form.form' );

See also

SeeAlso:JForm [Edit See Also]

User contributed notes

<CodeExamplesForm />