FOF30\Form\Header\HeaderBase::getLabel PHP Method

getLabel() protected method

Method to get the field label.
Since: 2.0
protected getLabel ( ) : string
return string The field label.
    protected function getLabel()
    {
        // Get the label text from the XML element, defaulting to the element name.
        $title = $this->element['label'] ? (string) $this->element['label'] : '';
        if (empty($title)) {
            $viewObject = $this->form->getView();
            $viewName = $viewObject->getName();
            $componentName = $viewObject->getContainer()->componentName;
            $title = $componentName . '_' . $this->form->getModel()->getContainer()->inflector->pluralize($viewName) . '_FIELD_' . (string) $this->element['name'];
            $title = strtoupper($title);
            $result = \JText::_($title);
            if ($result === $title) {
                $title = ucfirst((string) $this->element['name']);
            }
        }
        return $title;
    }