Fixing problem with submit options in FormHelper::end() (ticket #2516)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4987 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
dho 2007-05-02 12:56:51 +00:00
parent 90e05ed48e
commit 9b18367fcc
2 changed files with 6 additions and 3 deletions

View file

@ -214,9 +214,9 @@ class FormHelper extends AppHelper {
$submitOptions = $options['submit'];
unset($options['submit']);
if(isset($submitOptions['label'])) {
$submit = $submitOptions['label'];
unset($submitOptions['label']);
if(isset($options['label'])) {
$submitOptions = $options['label'];
unset($options['label']);
}
}

View file

@ -641,6 +641,9 @@ class FormHelperTest extends CakeTestCase {
function testFormEnd() {
$this->assertEqual($this->Form->end(), '</form>');
$result = $this->Form->end(array('submit' => 'save'));
$this->assertEqual($result, '<div class="submit"><input type="submit" value="save" /></div></form>');
}
function tearDown() {