mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Changing the default layout to use FlashComponent::render instead of the deprecated SessionComponent::flash. Changing the flash elements to retain the id attribute that was previously present. Also fixing file permissions on the template files I added.
This commit is contained in:
parent
7d5e6e3a3e
commit
70feb52f73
5 changed files with 5 additions and 4 deletions
|
@ -42,7 +42,7 @@ $cakeVersion = __d('cake_dev', 'CakePHP %s', Configure::version())
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
|
||||||
<?php echo $this->Session->flash(); ?>
|
<?php echo $this->Flash->render(); ?>
|
||||||
|
|
||||||
<?php echo $this->fetch('content'); ?>
|
<?php echo $this->fetch('content'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,4 +4,4 @@ if (!empty($params['class'])) {
|
||||||
$class .= ' ' . $params['class'];
|
$class .= ' ' . $params['class'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="<?= h($class) ?>"><?= h($message) ?></div>
|
<div id="<?= $key ?>Message" class="<?= h($class) ?>"><?= h($message) ?></div>
|
||||||
|
|
2
lib/Cake/View/Elements/Flash/error.ctp
Executable file → Normal file
2
lib/Cake/View/Elements/Flash/error.ctp
Executable file → Normal file
|
@ -1 +1 @@
|
||||||
<div class="message error"><?= h($message) ?></div>
|
<div id="<?= $key ?>Message" class="message error"><?= h($message) ?></div>
|
||||||
|
|
2
lib/Cake/View/Elements/Flash/success.ctp
Executable file → Normal file
2
lib/Cake/View/Elements/Flash/success.ctp
Executable file → Normal file
|
@ -1 +1 @@
|
||||||
<div class="message success"><?= h($message) ?></div>
|
<div id="<?= $key ?>Message" class="message success"><?= h($message) ?></div>
|
||||||
|
|
|
@ -84,6 +84,7 @@ class FlashHelper extends AppHelper {
|
||||||
|
|
||||||
$flash = $options + $flash;
|
$flash = $options + $flash;
|
||||||
CakeSession::delete("Message.$key");
|
CakeSession::delete("Message.$key");
|
||||||
|
$flash['key'] = $key;
|
||||||
|
|
||||||
return $this->_View->element($flash['element'], $flash);
|
return $this->_View->element($flash['element'], $flash);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue