Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removing variable name inflection from Controller::set()

  • Loading branch information...
commit c7d133fc0f5491debb70dcc87be39dd111687c5b 1 parent 5a7dc39
@nateabele nateabele authored
View
6 cake/libs/controller/controller.php
@@ -641,11 +641,7 @@ function set($one, $two = null) {
if ($name === 'title') {
$this->pageTitle = $value;
} else {
- if ($two === null && is_array($one)) {
- $this->viewVars[Inflector::variable($name)] = $value;
- } else {
- $this->viewVars[$name] = $value;
- }
+ $this->viewVars[$name] = $value;
}
}
}
View
4 cake/tests/cases/libs/controller/controller.test.php
@@ -657,7 +657,7 @@ function testControllerSet() {
$Controller->viewVars = array();
$viewVars = array('ModelName' => array('id' => 1, 'name' => 'value'));
$Controller->set($viewVars);
- $this->assertTrue(array_key_exists('modelName', $Controller->viewVars));
+ $this->assertTrue(array_key_exists('ModelName', $Controller->viewVars));
$Controller->viewVars = array();
$Controller->set('variable_with_underscores', 'value');
@@ -666,7 +666,7 @@ function testControllerSet() {
$Controller->viewVars = array();
$viewVars = array('ModelName' => 'name');
$Controller->set($viewVars);
- $this->assertTrue(array_key_exists('modelName', $Controller->viewVars));
+ $this->assertTrue(array_key_exists('ModelName', $Controller->viewVars));
$Controller->set('title', 'someTitle');
$this->assertIdentical($Controller->pageTitle, 'someTitle');
Please sign in to comment.
Something went wrong with that request. Please try again.