JForm/addField: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Method to add a field to a group.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki... |
No edit summary |
||
Line 17: | Line 17: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$field | ||
| | | | ||
| $field The field object to add. | | $field The field object to add. |
Revision as of 10:14, 30 March 2010
Description
Method to add a field to a group.
Template:Description:JForm/addField
Syntax
addField(&$field, $group= '_default')
Parameter Name | Default Value | Description |
---|---|---|
&$field | $field The field object to add. | |
$group | '_default' | $group The group to add the field to. |
Returns
void
Defined in
libraries/joomla/form/form.php
Importing
jimport( 'joomla.form.form' );
Source Body
public function addField(&$field, $group = '_default')
{
// Add the field to the group.
$this->_groups[$group][(string)$field->attributes()->name] = &$field;
}
[Edit See Also] Template:SeeAlso:JForm/addField
Examples
<CodeExamplesForm />