Skip to content

Commit 2f77320

Browse files
alphpMikael Capelle
authored and
Mikael Capelle
committed
$this->request deprecated in CakePHP 3.7.0
1 parent ae22797 commit 2f77320

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/View/Helper/FlashHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class FlashHelper extends \Cake\View\Helper\FlashHelper {
3333
* {@inheritDoc}
3434
*/
3535
public function render($key = 'flash', array $options = []) {
36-
if (!$this->request->getSession()->check("Flash.$key")) {
36+
if (!$this->getView()->getRequest()->getSession()->check("Flash.$key")) {
3737
return;
3838
}
3939

40-
$flash = $this->request->getSession()->read("Flash.$key");
40+
$flash = $this->getView()->getRequest()->getSession()->read("Flash.$key");
4141
if (!is_array($flash)) {
4242
throw new \UnexpectedValueException(sprintf(
4343
'Value for flash setting key "%s" must be an array.',
@@ -49,7 +49,7 @@ public function render($key = 'flash', array $options = []) {
4949
$message['element'] = 'Bootstrap.'.$message['element'];
5050
}
5151
}
52-
$this->request->getSession()->write("Flash.$key", $flash);
52+
$this->getView()->getRequest()->getSession()->write("Flash.$key", $flash);
5353

5454
return parent::render($key, $options);
5555
}

0 commit comments

Comments
 (0)