Fixing spacing between button tag attributes. Fixes #241

This commit is contained in:
ADmad 2010-01-21 22:03:03 +05:30
parent 913450daef
commit a8040506b0
2 changed files with 4 additions and 1 deletions

View file

@ -1170,7 +1170,7 @@ class FormHelper extends AppHelper {
return sprintf(
$this->Html->tags['button'],
$options['type'],
$this->_parseAttributes($options, array('type'), '', ' '),
$this->_parseAttributes($options, array('type'), ' ', ''),
$title
);
}

View file

@ -4753,6 +4753,9 @@ class FormHelperTest extends CakeTestCase {
$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'));