mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Refactoring ScaffoldView::_getViewFileName()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7569 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
311072f4ae
commit
fe82e827f0
2 changed files with 6 additions and 7 deletions
|
@ -510,14 +510,13 @@ class ScaffoldView extends ThemeView {
|
|||
}
|
||||
$paths = $this->_paths($this->plugin);
|
||||
|
||||
$exts = array($this->ext, '.ctp', '.thtml');
|
||||
foreach ($paths as $path) {
|
||||
foreach ($names as $name) {
|
||||
if (file_exists($path . $name . $this->ext)) {
|
||||
return $path . $name . $this->ext;
|
||||
} elseif (file_exists($path . $name . '.ctp')) {
|
||||
return $path . $name . '.thtml';
|
||||
} elseif (file_exists($path . $name . '.thtml')) {
|
||||
return $path . $name . '.thtml';
|
||||
foreach ($exts as $ext) {
|
||||
if (file_exists($path . $name . $ext)) {
|
||||
return $path . $name . $ext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -837,8 +837,8 @@ class View extends Object {
|
|||
$paths = $this->_paths($this->plugin);
|
||||
$file = 'layouts' . DS . $subDir . $name;
|
||||
|
||||
$exts = array($this->ext, '.ctp', '.thtml');
|
||||
foreach ($paths as $path) {
|
||||
$exts = array($this->ext, '.ctp', '.thtml');
|
||||
foreach ($exts as $ext) {
|
||||
if (file_exists($path . $file . $ext)) {
|
||||
return $path . $file . $ext;
|
||||
|
|
Loading…
Add table
Reference in a new issue