Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for render element - allow under_scored plugin name. #140

Merged
merged 1 commit into from

2 participants

This page is out of date. Refresh to see the latest.
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;
Something went wrong with that request. Please try again.