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:
DarkAngelBGE 2008-09-08 15:39:40 +00:00
parent 1520314cac
commit 311072f4ae

View file

@ -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');