Back to UrlField class

Method getLayoutData

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

Method getLayoutData - Source code

/**
 * Method to get the data to be passed to the layout for rendering.
 *
 * @return  array
 *
 * @since 3.7
 */
protected function getLayoutData()
{
    $data = parent::getLayoutData();
    // Initialize some field attributes.
    $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
    // Note that the input type "url" is suitable only for external URLs, so if internal URLs are allowed
    // we have to use the input type "text" instead.
    $inputType = $this->element['relative'] ? 'type="text"' : 'type="url"';
    $extraData = array('maxLength' => $maxLength, 'inputType' => $inputType);
    return array_merge($data, $extraData);
}