3 class HTMLTextField
extends HTMLFormField
{
5 return isset( $this->mParams
['size'] ) ?
$this->mParams
['size'] : 45;
8 function getInputHTML( $value ) {
11 'name' => $this->mName
,
12 'size' => $this->getSize(),
14 ) +
$this->getTooltipAndAccessKey();
16 if ( $this->mClass
!== '' ) {
17 $attribs['class'] = $this->mClass
;
20 # @todo Enforce pattern, step, required, readonly on the server side as
22 $allowedParams = array(
39 $attribs +
= $this->getAttributes( $allowedParams );
41 # Implement tiny differences between some field variants
42 # here, rather than creating a new class for each one which
43 # is essentially just a clone of this one.
44 if ( isset( $this->mParams
['type'] ) ) {
45 switch ( $this->mParams
['type'] ) {
47 $attribs['type'] = 'number';
50 $attribs['type'] = 'number';
51 $attribs['step'] = 'any';
58 $attribs['type'] = $this->mParams
['type'];
63 return Html
::element( 'input', $attribs );