Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

pluginSplit for a more meaningful notice #1028

Merged
merged 1 commit into from

2 participants

Mark S. Mark Story
Mark S.
Collaborator

If you got an element like

<?php echo $this->element('PluginName.subfolder/piece'); ?>

currently the notice would be

Notice (1024): Element Not Found: Elements\PluginName.subfolder/piece.ctp [CORE\Cake\View\View.php, line 418]

whereas this would make much more sense:

Notice (1024): Element Not Found: PluginName.Elements\subfolder\piece.ctp [CORE\Cake\View\View.php, line 418]

fixing both the PluginName (move to the front) and the different DS

Mark Story markstory merged commit c67c4d3 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 15, 2012
  1. Mark S.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Cake/View/View.php
4 lib/Cake/View/View.php
View
@@ -414,7 +414,9 @@ public function element($name, $data = array(), $options = array()) {
}
if (empty($options['ignoreMissing'])) {
- $file = 'Elements' . DS . $name . $this->ext;
+ list ($plugin, $name) = pluginSplit($name, true);
+ $name = str_replace('/', DS, $name);
+ $file = $plugin . 'Elements' . DS . $name . $this->ext;
trigger_error(__d('cake_dev', 'Element Not Found: %s', $file), E_USER_NOTICE);
}
}
Something went wrong with that request. Please try again.