Permalink
Browse files

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

  • Loading branch information...
1 parent a1f63a1 commit 71ed244f14eb97f4144ff021bfbc0b9d94d39c91 @majna majna committed Jul 2, 2011
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
@@ -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');
@@ -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;

0 comments on commit 71ed244

Please sign in to comment.