Back to FormField class

Method getLabel

protected string
getLabel
()
Method to get the field label markup.
Returns
  • string The field label markup.
Since
  • 1.7.0
Class: FormField
Project: Joomla

Method getLabel - Source code

/**
 * Method to get the field label markup.
 *
 * @return  string  The field label markup.
 *
 * @since   1.7.0
 */
protected function getLabel()
{
    if ($this->hidden) {
        return '';
    }
    $data = $this->getLayoutData();
    // Forcing the Alias field to display the tip below
    $position = $this->element['name'] === 'alias' ? ' data-bs-placement="bottom" ' : '';
    // Here mainly for B/C with old layouts. This can be done in the layouts directly
    $extraData = array('text' => $data['label'], 'for' => $this->id, 'classes' => explode(' ', $data['labelclass']), 'position' => $position);
    return $this->getRenderer($this->renderLabelLayout)->render(array_merge($data, $extraData));
}