Fixes #291
This commit is contained in:
1 parent
3dcf2185a1
commit
4f6701c7c3
2 files changed
+6
-2
No files matched your search
+2
-2
@@ -449,9 +449,9 @@ class HtmlBuilder
|
|||||||
if (is_numeric($key)) {
|
if (is_numeric($key)) {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Treat boolean attributes as HTML properties
|
// Treat boolean attributes as HTML properties
|
||||||
if (is_bool($value)) {
|
if (is_bool($value) && $key != 'value') {
|
||||||
return $value ? $key : '';
|
return $value ? $key : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,10 +110,14 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase
|
|||||||
$form1 = $this->formBuilder->input('text', 'foo');
|
$form1 = $this->formBuilder->input('text', 'foo');
|
||||||
$form2 = $this->formBuilder->input('text', 'foo', 'foobar');
|
$form2 = $this->formBuilder->input('text', 'foo', 'foobar');
|
||||||
$form3 = $this->formBuilder->input('date', 'foobar', null, ['class' => 'span2']);
|
$form3 = $this->formBuilder->input('date', 'foobar', null, ['class' => 'span2']);
|
||||||
|
$form4 = $this->formBuilder->input('hidden', 'foo', true);
|
||||||
|
$form6 = $this->formBuilder->input('checkbox', 'foo-check', true);
|
||||||
|
|
||||||
$this->assertEquals('<input name="foo" type="text">', $form1);
|
$this->assertEquals('<input name="foo" type="text">', $form1);
|
||||||
$this->assertEquals('<input name="foo" type="text" value="foobar">', $form2);
|
$this->assertEquals('<input name="foo" type="text" value="foobar">', $form2);
|
||||||
$this->assertEquals('<input class="span2" name="foobar" type="date">', $form3);
|
$this->assertEquals('<input class="span2" name="foobar" type="date">', $form3);
|
||||||
|
$this->assertEquals('<input name="foo" type="hidden" value="1">', $form4);
|
||||||
|
$this->assertEquals('<input name="foo-check" type="checkbox" value="1">', $form6);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPasswordsNotFilled()
|
public function testPasswordsNotFilled()
|
||||||
|
|||||||
Reference in new issue
Block a user