Permalink
Browse files

Fixing spacing between button tag attributes. Fixes #241

  • Loading branch information...
1 parent 913450d commit a8040506b0288683feb38602b1054ce3c7a2795b @ADmad ADmad committed Jan 21, 2010
Showing with 4 additions and 1 deletion.
  1. +1 −1 cake/libs/view/helpers/form.php
  2. +3 −0 cake/tests/cases/libs/view/helpers/form.test.php
@@ -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
);
}
@@ -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'));

0 comments on commit a804050

Please sign in to comment.