fix for view files in scaffold

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3993 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2006-11-27 16:04:11 +00:00
parent d6159f1b09
commit 41faae6265

View file

@ -296,10 +296,10 @@ class Scaffold extends Object {
$this->controller->set('fieldNames', $this->controller->generateFieldNames($this->__rebuild($this->controller->data))); $this->controller->set('fieldNames', $this->controller->generateFieldNames($this->__rebuild($this->controller->data)));
$this->controller->validateErrors($this->ScaffoldModel); $this->controller->validateErrors($this->ScaffoldModel);
if (file_exists(APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS . 'scaffold.' . $action . '.thtml')) { if (file_exists(APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS . 'scaffold.' . $viewFileName . '.thtml')) {
return $this->controller->render($viewFileName, '', APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS . 'scaffold.' . $thtml . '.thtml'); return $this->controller->render($viewFileName, '', APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS . 'scaffold.' . $viewFileName . '.thtml');
} elseif(file_exists(APP . 'views' . DS . 'scaffold' . DS . 'scaffold.' . $action . '.thtml')) { } elseif(file_exists(APP . 'views' . DS . 'scaffold' . DS . 'scaffold.' . $viewFileName . '.thtml')) {
return $this->controller->render($viewFileName, '', APP . 'views' . DS . 'scaffold' . DS . 'scaffold.' . $action . '.thtml'); return $this->controller->render($viewFileName, '', APP . 'views' . DS . 'scaffold' . DS . 'scaffold.' . $viewFileName . '.thtml');
} else { } else {
return $this->controller->render($viewFileName, '', LIBS . 'view' . DS . 'templates' . DS . 'scaffolds' . DS . 'edit.thtml'); return $this->controller->render($viewFileName, '', LIBS . 'view' . DS . 'templates' . DS . 'scaffolds' . DS . 'edit.thtml');
} }