Skip to content

Commit a804050

Browse files
committed
Fixing spacing between button tag attributes. Fixes #241
1 parent 913450d commit a804050

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cake/libs/view/helpers/form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ function button($title, $options = array()) {
11701170
return sprintf(
11711171
$this->Html->tags['button'],
11721172
$options['type'],
1173-
$this->_parseAttributes($options, array('type'), '', ' '),
1173+
$this->_parseAttributes($options, array('type'), ' ', ''),
11741174
$title
11751175
);
11761176
}

cake/tests/cases/libs/view/helpers/form.test.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4753,6 +4753,9 @@ function testButton() {
47534753
$result = $this->Form->button('Clear Form >', array('type' => 'reset'));
47544754
$this->assertTags($result, array('button' => array('type' => 'reset'), 'Clear Form >', '/button'));
47554755

4756+
$result = $this->Form->button('Clear Form >', array('type' => 'reset', 'id' => 'clearForm'));
4757+
$this->assertTags($result, array('button' => array('type' => 'reset', 'id' => 'clearForm'), 'Clear Form >', '/button'));
4758+
47564759
$result = $this->Form->button('<Clear Form>', array('type' => 'reset', 'escape' => true));
47574760
$this->assertTags($result, array('button' => array('type' => 'reset'), '&lt;Clear Form&gt;', '/button'));
47584761

0 commit comments

Comments
 (0)