JForm/getLabel
From Joomla! Documentation
< API16:JForm
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Method to get the label for a field.
<! removed transcluded page call, red link never existed >
Syntax[edit]
getLabel($name, $group= '_default', $formControl= '_default', $groupControl= '_default', $value=null)
Parameter Name | Default Value | Description |
---|---|---|
$name | $name The field name. | |
$group | '_default' | $group The group the field is in. |
$formControl | '_default' | $formControl The optional form control. Set to false to disable. |
$groupControl | '_default' | $groupControl The optional group control. Set to false to disable. |
$value | null | $value The optional value to render as the default for the field. |
Returns[edit]
string The form field label.
Defined in[edit]
libraries/joomla/form/form.php
Importing[edit]
jimport( 'joomla.form.form' );
Source Body[edit]
public function getLabel($name, $group = '_default', $formControl = '_default', $groupControl = '_default', $value = null)
{
// Render the field label.
$field = $this->getField($name, $group, $formControl, $groupControl, $value);
$label = $field->label;
return $label;
}
<! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]