Back to FormField class

Method getLayoutData

protected array
getLayoutData
()
Method to get the data to be passed to the layout for rendering.
Returns
  • array
Since
  • 3.5
Class: FormField
Project: Joomla

Method getLayoutData - Source code

/**
 * Method to get the data to be passed to the layout for rendering.
 *
 * @return  array
 *
 * @since 3.5
 */
protected function getLayoutData()
{
    // Label preprocess
    $label = !empty($this->element['label']) ? (string) $this->element['label'] : null;
    $label = $label && $this->translateLabel ? Text::_($label) : $label;
    // Description preprocess
    $description = !empty($this->description) ? $this->description : null;
    $description = !empty($description) && $this->translateDescription ? Text::_($description) : $description;
    $alt = preg_replace('/[^a-zA-Z0-9_\\-]/', '_', $this->fieldname);
    return ['autocomplete' => $this->autocomplete, 'autofocus' => $this->autofocus, 'class' => $this->class, 'description' => $description, 'disabled' => $this->disabled, 'field' => $this, 'group' => $this->group, 'hidden' => $this->hidden, 'hint' => $this->translateHint ? Text::alt($this->hint, $alt) : $this->hint, 'id' => $this->id, 'label' => $label, 'labelclass' => $this->labelclass, 'multiple' => $this->multiple, 'name' => $this->name, 'onchange' => $this->onchange, 'onclick' => $this->onclick, 'pattern' => $this->pattern, 'validationtext' => $this->validationtext, 'readonly' => $this->readonly, 'repeat' => $this->repeat, 'required' => (bool) $this->required, 'size' => $this->size, 'spellcheck' => $this->spellcheck, 'validate' => $this->validate, 'value' => $this->value, 'dataAttribute' => $this->renderDataAttributes(), 'dataAttributes' => $this->dataAttributes, 'parentclass' => $this->parentclass];
}