- md5
- 47adf4d37507a63a781ed694e7069d36
- sha1
- c7c5f987679e55f7b444a7a8717e19f06b1433f9
- sha256
- b6eb5a3ffde4d837e3d981df7d41c009f990364737e4e23c3f91e02f53416fc0
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Form\Field;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Form\FormHelper;
FormHelper::loadFieldClass('text');
/**
* Form Field class for the Joomla Platform.
* Supports a text field telephone numbers.
*
* @link http://www.w3.org/TR/html-markup/input.tel.html
* @see JFormRuleTel for telephone number validation
* @see JHtmlTel for rendering of telephone numbers
* @since 11.1
*/
class TelephoneField extends \JFormFieldText
{
/**
* The form field type.
*
* @var string
* @since 11.1
*/
protected $type = 'Telephone';
/**
* Name of the layout being used to render the field
*
* @var string
* @since 3.7.0
*/
protected $layout = 'joomla.form.field.tel';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 3.2
*/
protected function getInput()
{
// Trim the trailing line in the layout file
return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL);
}
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.7.0
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
// Initialize some field attributes.
$maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
$extraData = array(
'maxLength' => $maxLength,
);
return array_merge($data, $extraData);
}
}
No other release has this exact content. See every version of this file.