summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
635b2ce)
Thinko: while it does create an input tag, it's specifically for text
input elements. Was already documented as text().
return $self->tag(input => $attr);
}
return $self->tag(input => $attr);
}
my $self = shift;
my ($name, $value, $attr) = $self->_attr(2, @_);
my $self = shift;
my ($name, $value, $attr) = $self->_attr(2, @_);
'<input type="text">',
'empty input'
);
is(
'<input type="text">',
'empty input'
);
is(
- $form->input(undef, undef, undef),
+ $form->text(undef, undef, undef),
'<input type="text">',
'explicit empty input'
);
is(
'<input type="text">',
'explicit empty input'
);
is(
'<input id="test" name="test" type="text">',
'input with name'
);
is(
'<input id="test" name="test" type="text">',
'input with name'
);
is(
- $form->input(undef, 'test'),
+ $form->text(undef, 'test'),
'<input type="text" value="test">',
'input with value'
);
is(
'<input type="text" value="test">',
'input with value'
);
is(
- $form->input(undef, {value => 'test'}),
+ $form->text(undef, {value => 'test'}),
'<input type="text" value="test">',
'input with attribute value'
);
is(
'<input type="text" value="test">',
'input with attribute value'
);
is(
- $form->input({name => 'test', value => ''}),
+ $form->text({name => 'test', value => ''}),
'<input id="test" name="test" type="text" value="">',
'input with only attributes'
);
is(
'<input id="test" name="test" type="text" value="">',
'input with only attributes'
);
is(
disabled => 0,
something => undef,
class => undef,
disabled => 0,
something => undef,
class => undef,
- $form->input(undef, undef, {name => '0', value => '0'}),
+ $form->text(undef, undef, {name => '0', value => '0'}),
'<input id="0" name="0" type="text" value="0">',
'input overrides'
);
is(
'<input id="0" name="0" type="text" value="0">',
'input overrides'
);
is(
- $form->input('name', {id => ''}),
+ $form->text('name', {id => ''}),
'<input name="name" type="text">',
'input with id override'
);
is(
'<input name="name" type="text">',
'input with id override'
);
is(
- $form->input('<">', '<">', {id => '>"<'}),
+ $form->text('<">', '<">', {id => '>"<'}),
'<input id=">"<" name="<">" type="text" value="<">">',
'input quoting'
);
is(
'<input id=">"<" name="<">" type="text" value="<">">',
'input quoting'
);
is(
- $form->input(undef, {disabled => 'something'}),
+ $form->text(undef, {disabled => 'something'}),
'<input disabled type="text">',
'disabled input'
);
is(
'<input disabled type="text">',
'disabled input'
);
is(
- $form->input({type => 'password'}),
+ $form->text({type => 'password'}),
'<input type="password">',
'password'
);
'<input type="password">',
'password'
);
- $form->input({rows => 0}),
+ $form->text({rows => 0}),
'<textarea rows="0"></textarea>',
'minimal textarea'
);
is(
'<textarea rows="0"></textarea>',
'minimal textarea'
);
is(
- $form->input(foo => 'bar', {cols => 42, rows => 1, disabled => 1}),
+ $form->text(foo => 'bar', {cols => 42, rows => 1, disabled => 1}),
'<textarea disabled cols="42" id="foo" name="foo" rows="1">bar</textarea>',
'textarea'
);
is(
'<textarea disabled cols="42" id="foo" name="foo" rows="1">bar</textarea>',
'textarea'
);
is(
- $form->input(undef, qq{<foo>&bl'a"\n .}, {cols => undef, rows => '<">'}),
+ $form->text(undef, qq{<foo>&bl'a"\n .}, {cols => undef, rows => '<">'}),
qq{<textarea rows="<">"><foo>&bl'a"\n .</textarea>},
'textarea quoting'
);
qq{<textarea rows="<">"><foo>&bl'a"\n .</textarea>},
'textarea quoting'
);