Skip to content

Commit

Permalink
Fixing spacing between button tag attributes. Fixes #241
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jan 21, 2010
1 parent 913450d commit a804050
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/view/helpers/form.php
Expand Up @@ -1170,7 +1170,7 @@ function button($title, $options = array()) {
return sprintf(
$this->Html->tags['button'],
$options['type'],
$this->_parseAttributes($options, array('type'), '', ' '),
$this->_parseAttributes($options, array('type'), ' ', ''),
$title
);
}
Expand Down
3 changes: 3 additions & 0 deletions cake/tests/cases/libs/view/helpers/form.test.php
Expand Up @@ -4753,6 +4753,9 @@ function testButton() {
$result = $this->Form->button('Clear Form >', array('type' => 'reset'));
$this->assertTags($result, array('button' => array('type' => 'reset'), 'Clear Form >', '/button'));

$result = $this->Form->button('Clear Form >', array('type' => 'reset', 'id' => 'clearForm'));
$this->assertTags($result, array('button' => array('type' => 'reset', 'id' => 'clearForm'), 'Clear Form >', '/button'));

$result = $this->Form->button('<Clear Form>', array('type' => 'reset', 'escape' => true));
$this->assertTags($result, array('button' => array('type' => 'reset'), '&lt;Clear Form&gt;', '/button'));

Expand Down

0 comments on commit a804050

Please sign in to comment.