Skip to content

Commit

Permalink
Rename local var.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Aug 16, 2015
1 parent 64c471d commit 6645961
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/View/View.php
Expand Up @@ -993,13 +993,13 @@ public function loadHelper($name, array $config = [])
*/
protected function _getViewFileName($name = null)
{
$viewPath = $subDir = '';
$templatePath = $subDir = '';

if ($this->subDir !== null) {
$subDir = $this->subDir . DS;
}
if ($this->templatePath) {
$viewPath = $this->templatePath . DS;
$templatePath = $this->templatePath . DS;
}

if ($name === null) {
Expand All @@ -1010,15 +1010,15 @@ protected function _getViewFileName($name = null)
$name = str_replace('/', DS, $name);

if (strpos($name, DS) === false && $name[0] !== '.') {
$name = $viewPath . $subDir . Inflector::underscore($name);
$name = $templatePath . $subDir . Inflector::underscore($name);
} elseif (strpos($name, DS) !== false) {
if ($name[0] === DS || $name[1] === ':') {
if (is_file($name)) {
return $name;
}
$name = trim($name, DS);
} elseif (!$plugin || $this->templatePath !== $this->name) {
$name = $viewPath . $subDir . $name;
$name = $templatePath . $subDir . $name;
} else {
$name = DS . $subDir . $name;
}
Expand Down Expand Up @@ -1185,11 +1185,11 @@ protected function _paths($plugin = null, $cached = true)
return $this->_pathsForPlugin[$plugin];
}
}
$viewPaths = App::path('Template');
$templatePaths = App::path('Template');
$pluginPaths = $themePaths = [];
if (!empty($plugin)) {
for ($i = 0, $count = count($viewPaths); $i < $count; $i++) {
$pluginPaths[] = $viewPaths[$i] . 'Plugin' . DS . $plugin . DS;
for ($i = 0, $count = count($templatePaths); $i < $count; $i++) {
$pluginPaths[] = $templatePaths[$i] . 'Plugin' . DS . $plugin . DS;
}
$pluginPaths = array_merge($pluginPaths, App::path('Template', $plugin));
}
Expand All @@ -1198,7 +1198,7 @@ protected function _paths($plugin = null, $cached = true)
$themePaths = App::path('Template', Inflector::camelize($this->theme));

if ($plugin) {
for ($i = 0, $count = count($viewPaths); $i < $count; $i++) {
for ($i = 0, $count = count($templatePaths); $i < $count; $i++) {
array_unshift($themePaths, $themePaths[$i] . 'Plugin' . DS . $plugin . DS);
}
}
Expand All @@ -1207,7 +1207,7 @@ protected function _paths($plugin = null, $cached = true)
$paths = array_merge(
$themePaths,
$pluginPaths,
$viewPaths,
$templatePaths,
[dirname(__DIR__) . DS . 'Template' . DS]
);

Expand Down

0 comments on commit 6645961

Please sign in to comment.