# Implement tiny differences between some field variants
# here, rather than creating a new class for each one which
# is essentially just a clone of this one.
+ $type = 'text';
if ( isset( $this->mParams['type'] ) ) {
switch ( $this->mParams['type'] ) {
- case 'email':
- $attribs['type'] = 'email';
- break;
case 'int':
- $attribs['type'] = 'number';
+ $type = 'number';
break;
case 'float':
- $attribs['type'] = 'number';
+ $type = 'number';
$attribs['step'] = 'any';
break;
# Pass through
+ case 'email':
case 'password':
case 'file':
- $attribs['type'] = $this->mParams['type'];
+ case 'url':
+ $type = $this->mParams['type'];
break;
}
}
-
- return Html::element( 'input', $attribs );
+ return Html::input( $this->mName, $value, $type, $attribs );
}
}