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(
40 $attribs +
= $this->getAttributes( $allowedParams );
43 $type = isset( $attribs['type'] ) ?
$attribs['type'] : 'text';
44 unset( $attribs['type'] );
46 # Implement tiny differences between some field variants
47 # here, rather than creating a new class for each one which
48 # is essentially just a clone of this one.
49 if ( isset( $this->mParams
['type'] ) ) {
50 switch ( $this->mParams
['type'] ) {
56 $attribs['step'] = 'any';
63 $type = $this->mParams
['type'];
68 return Html
::input( $this->mName
, $value, $type, $attribs );