Actions

API16

JForm/getLabel

From Joomla! Documentation

< API16:JForm
Revision as of 17:50, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Contents

Description

Method to get the label for a field.

[Edit Descripton]

Description:JForm/getLabel

Syntax

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

string The form field label.

Defined in

libraries/joomla/form/form.php

Importing

jimport( 'joomla.form.form' );

Source Body

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;
}

[Edit See Also] SeeAlso:JForm/getLabel

Examples

<CodeExamplesForm />