From 71ed244f14eb97f4144ff021bfbc0b9d94d39c91 Mon Sep 17 00:00:00 2001 From: Majna Date: Sat, 2 Jul 2011 02:17:44 +0200 Subject: [PATCH] Fix for render element - allow under_scored plugin name. Fixes #1814 --- lib/Cake/Test/Case/View/ViewTest.php | 3 +++ lib/Cake/View/View.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index d4c1a30ea0e..e1c8d7aaf6d 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/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'); diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index c08559c895f..e233e16eee5 100644 --- a/lib/Cake/View/View.php +++ b/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;