Unable to display Flash messages in Cakephp 3.x -
i not able flash messages display on of views.
an example of trying call flash message in controller (which untouched cake bake except message, syntax has stayed same).
$this->flash->success('your account has been created!'); in appcontroller initialize function:
$this->loadcomponent('flash'); in default layout:
<?= $this->flash->render() ?> <?= $this->fetch('content') ?> i not getting error messages, far can see , after doing lots of research issue seems set correctly.
the flash messages visible in session, when declare them key:
$this->flash->default('a message... ',['key' => 'cutom_error_key',]); $this->flash->success('welcome',['key' => 'loggedin']); i have made sure valid flash .ctp files in element\flash folder (copied working project after running issue).
any ideas causing issue?
add following in controller:
use cake\controller\component\flashcomponent;
Comments
Post a Comment