mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
How about this?
This commit is contained in:
parent
ef1fc7dfef
commit
8257100f54
5 changed files with 4 additions and 11 deletions
|
@ -0,0 +1 @@
|
|||
<div id="<?php echo $key; ?>Message" class="<?php echo !empty($params['class']) ? $params['class'] : 'message'; ?>"><?php echo $message; ?></div>
|
|
@ -50,7 +50,7 @@ class AuthComponent extends Component {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public $components = array('Session', 'RequestHandler');
|
||||
public $components = array('Session', 'Flash', 'RequestHandler');
|
||||
|
||||
/**
|
||||
* An array of authentication objects to use for authenticating users. You can configure
|
||||
|
@ -840,7 +840,7 @@ class AuthComponent extends Component {
|
|||
if ($message === false) {
|
||||
return;
|
||||
}
|
||||
$this->Session->setFlash($message, $this->flash['element'], $this->flash['params'], $this->flash['key']);
|
||||
$this->Flash->set($message, $this->flash);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
1
lib/Cake/View/Elements/Flash/default.ctp
Normal file
1
lib/Cake/View/Elements/Flash/default.ctp
Normal file
|
@ -0,0 +1 @@
|
|||
<div id="<?php echo $key; ?>Message" class="<?php echo !empty($params['class']) ? $params['class'] : 'message'; ?>"><?php echo $message; ?></div>
|
|
@ -85,15 +85,6 @@ class FlashHelper extends AppHelper {
|
|||
$flash = $options + $flash;
|
||||
CakeSession::delete("Message.$key");
|
||||
|
||||
// backwards compatibility with Session->setFlash()
|
||||
if ($flash['element'] === 'default') {
|
||||
$class = 'message';
|
||||
if (!empty($flash['params']['class'])) {
|
||||
$class = $flash['params']['class'];
|
||||
}
|
||||
return '<div id="' . $key . 'Message" class="' . $class . '">' . $flash['message'] . '</div>';
|
||||
}
|
||||
|
||||
return $this->_View->element($flash['element'], $flash);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue