Skip to content

Commit

Permalink
Update View.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hashmode committed Aug 9, 2016
1 parent 971da66 commit d8fbefa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/View/View.php
Expand Up @@ -483,7 +483,8 @@ public function element($name, array $data = [], array $options = [])
$options['cache'] = $this->_elementCache($name, $data, $options);
}

$file = $this->_getElementFilename($name);
$pluginCheck = isset($options['plugin']) && $options['plugin'] === false ? false : true;
$file = $this->_getElementFilename($name, $pluginCheck);
if ($file && $options['cache']) {
return $this->cache(function () use ($file, $data, $options) {
echo $this->_renderElement($file, $data, $options);
Expand Down Expand Up @@ -1143,6 +1144,7 @@ public function pluginSplit($name, $fallback = true)
$name = $second;
$plugin = $first;
}

if (isset($this->plugin) && !$plugin && $fallback) {
$plugin = $this->plugin;
}
Expand Down Expand Up @@ -1190,9 +1192,9 @@ protected function _getLayoutFileName($name = null)
* @param string $name The name of the element to find.
* @return string|false Either a string to the element filename or false when one can't be found.
*/
protected function _getElementFileName($name)
protected function _getElementFileName($name, $pluginCheck = true)
{
list($plugin, $name) = $this->pluginSplit($name);
list($plugin, $name) = $this->pluginSplit($name, $pluginCheck);

$paths = $this->_paths($plugin);
$elementPaths = $this->_getSubPaths('Element');
Expand Down

0 comments on commit d8fbefa

Please sign in to comment.