Browse Source

Merge pull request #4754 from cakephp/3.0-formhelper

Don't underscore plugin and controller names when generating form url.
José Lorenzo Rodríguez 11 years ago
parent
commit
db085ed8f6
2 changed files with 4 additions and 5 deletions
  1. 2 3
      src/View/Helper/FormHelper.php
  2. 2 2
      tests/TestCase/View/Helper/FormHelperTest.php

+ 2 - 3
src/View/Helper/FormHelper.php

@@ -381,10 +381,9 @@ class FormHelper extends Helper {
 			$options['url']['action'] = $options['action'];
 		}
 
-		$plugin = $this->plugin ? Inflector::underscore($this->plugin) : null;
 		$actionDefaults = [
-			'plugin' => $plugin,
-			'controller' => Inflector::underscore($this->request->params['controller']),
+			'plugin' => $this->plugin,
+			'controller' => $this->request->params['controller'],
 			'action' => $this->request->params['action'],
 		];
 

+ 2 - 2
tests/TestCase/View/Helper/FormHelperTest.php

@@ -516,11 +516,11 @@ class FormHelperTest extends TestCase {
 		);
 		$this->assertHtml($expected, $result);
 
-		$this->Form->request['controller'] = 'pages';
+		$this->Form->request['controller'] = 'Pages';
 		$result = $this->Form->create($this->article, array('action' => 'signup'));
 		$expected = array(
 			'form' => array(
-				'method' => 'post', 'action' => '/pages/signup/1',
+				'method' => 'post', 'action' => '/Pages/signup/1',
 				'accept-charset' => $encoding
 			),
 			'div' => array('style' => 'display:none;'),