updating View and Controller::flash, fixes #3749, tests added

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6177 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-12-20 01:19:19 +00:00
parent 1752d936d9
commit 60f4dd360d
4 changed files with 125 additions and 38 deletions

View file

@ -740,19 +740,11 @@ class Controller extends Object {
*/
function flash($message, $url, $pause = 1) {
$this->autoRender = false;
$this->autoLayout = false;
$this->set('url', Router::url($url));
$this->set('message', $message);
$this->set('pause', $pause);
$this->set('page_title', $message);
if (file_exists(VIEWS . 'layouts' . DS . 'flash.ctp')) {
$flash = VIEWS . 'layouts' . DS . 'flash.ctp';
} elseif (file_exists(VIEWS . 'layouts' . DS . 'flash.thtml')) {
$flash = VIEWS . 'layouts' . DS . 'flash.thtml';
} elseif ($flash = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . "layouts" . DS . 'flash.ctp')) {
}
$this->render(null, false, $flash);
$this->render(false, 'flash');
}
/**
* Converts POST'ed model data to a model conditions array, suitable for a find