mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Refactoring View::_getLayoutFileName()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7568 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1520314cac
commit
311072f4ae
1 changed files with 5 additions and 6 deletions
|
@ -838,12 +838,11 @@ class View extends Object {
|
|||
$file = 'layouts' . DS . $subDir . $name;
|
||||
|
||||
foreach ($paths as $path) {
|
||||
if (file_exists($path . $file . $this->ext)) {
|
||||
return $path . $file . $this->ext;
|
||||
} elseif (file_exists($path . $file . '.ctp')) {
|
||||
return $path . $file . '.ctp';
|
||||
} elseif (file_exists($path . $file . '.thtml')) {
|
||||
return $path . $file . '.thtml';
|
||||
$exts = array($this->ext, '.ctp', '.thtml');
|
||||
foreach ($exts as $ext) {
|
||||
if (file_exists($path . $file . $ext)) {
|
||||
return $path . $file . $ext;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->_missingView($paths[0] . $file . $this->ext, 'missingLayout');
|
||||
|
|
Loading…
Reference in a new issue