Fixed an issue with input types

This commit is contained in:
Josh Sherman 2013-02-02 16:18:48 -05:00
parent 9c73061a0a
commit 358bf0eefa
2 changed files with 6 additions and 2 deletions

View file

@ -41,7 +41,7 @@ class HTML extends Object
} }
// ->inputType('name', $attributes); // ->inputType('name', $attributes);
if (preg_match('/^input/', $method)) if (preg_match('/^input/', $method) && !isset($attributes['label']))
{ {
$type = strtolower(str_replace('input', '', $method)); $type = strtolower(str_replace('input', '', $method));
@ -51,6 +51,8 @@ class HTML extends Object
case '': $type = 'text'; break; case '': $type = 'text'; break;
} }
$method = 'input';
if (is_array($attributes)) if (is_array($attributes))
{ {
$attributes['type'] = $type; $attributes['type'] = $type;

View file

@ -4200,7 +4200,7 @@ class HTML extends Object
} }
// ->inputType('name', $attributes); // ->inputType('name', $attributes);
if (preg_match('/^input/', $method)) if (preg_match('/^input/', $method) && !isset($attributes['label']))
{ {
$type = strtolower(str_replace('input', '', $method)); $type = strtolower(str_replace('input', '', $method));
@ -4210,6 +4210,8 @@ class HTML extends Object
case '': $type = 'text'; break; case '': $type = 'text'; break;
} }
$method = 'input';
if (is_array($attributes)) if (is_array($attributes))
{ {
$attributes['type'] = $type; $attributes['type'] = $type;