/**
* 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 . '"' : '';
$inputmode = !empty($this->inputmode) ? ' inputmode="' . $this->inputmode . '"' : '';
$dirname = !empty($this->dirname) ? ' dirname="' . $this->dirname . '"' : '';
// Get the field options for the datalist.
$options = (array) $this->getOptions();
$extraData = array('maxLength' => $maxLength, 'pattern' => $this->pattern, 'inputmode' => $inputmode, 'dirname' => $dirname, 'addonBefore' => $this->addonBefore, 'addonAfter' => $this->addonAfter, 'options' => $options);
return array_merge($data, $extraData);
}