Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jul 2, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/Cake/Test/Case/View/ViewTest.php
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/View.php
Expand Up @@ -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;
Expand Down