Browse Source

Also allow setting 'action' to false

ADmad 11 years ago
parent
commit
a8e39ed3c4
2 changed files with 4 additions and 1 deletions
  1. 1 1
      src/View/Helper/FormHelper.php
  2. 3 0
      tests/TestCase/View/Helper/FormHelperTest.php

+ 1 - 1
src/View/Helper/FormHelper.php

@@ -367,7 +367,7 @@ class FormHelper extends Helper
         }
         unset($options['templates']);
 
-        if ($options['url'] === false) {
+        if ($options['action'] === false || $options['url'] === false) {
             $url = $this->request->here(false);
             $action = null;
         } else {

+ 3 - 0
tests/TestCase/View/Helper/FormHelperTest.php

@@ -691,6 +691,9 @@ class FormHelperTest extends TestCase
             '/div'
         ];
         $this->assertHtml($expected, $result);
+
+        $result = $this->Form->create(false, ['action' => false]);
+        $this->assertHtml($expected, $result);
     }
 
     /**