Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for render element - allow under_scored plugin name. Fixes #1814

  • Loading branch information...
commit 71ed244f14eb97f4144ff021bfbc0b9d94d39c91 1 parent a1f63a1
@majna majna authored
Showing with 4 additions and 1 deletion.
  1. +3 −0  lib/Cake/Test/Case/View/ViewTest.php
  2. +1 −1  lib/Cake/View/View.php
View
3  lib/Cake/Test/Case/View/ViewTest.php
@@ -431,6 +431,9 @@ public function testElement() {
$result = $this->View->element('plugin_element', array(), array('plugin' => 'TestPlugin'));
$this->assertEqual($result, 'this is the plugin element using params[plugin]');
+
+ $result = $this->View->element('plugin_element', array(), array('plugin' => 'test_plugin'));
+ $this->assertEqual($result, 'this is the plugin element using params[plugin]');
$this->View->plugin = 'TestPlugin';
$result = $this->View->element('test_plugin_element');
View
2  lib/Cake/View/View.php
@@ -306,7 +306,7 @@ public function element($name, $data = array(), $options = array()) {
$callbacks = false;
if (isset($options['plugin'])) {
- $plugin = $options['plugin'];
+ $plugin = Inflector::camelize($options['plugin']);
}
if (isset($this->plugin) && !$plugin) {
$plugin = $this->plugin;
Please sign in to comment.
Something went wrong with that request. Please try again.