i'm having trouble showing flash messages phalcon php. here how register service:
use phalcon\flash\direct flash; $di->set('flash', function () { return new flash(array( 'error' => 'alert alert-danger', 'success' => 'alert alert-success', 'notice' => 'alert alert-info', 'warning' => 'alert alert-warning' )); }); in controller add flash message this
$this->flash->success('the carrier activated'); in view try show (volt):
{{ flash.output() }} my layout has {{ content() }} tag , have tried apply discussed in this post doesn't work anyway.
can see i'm missing here? help!
your using wrong flash session. instead of
use phalcon\flash\direct flash; use
use phalcon\flash\session flash; the documentation says:
flash\directdirectly outputs messages passed flash.flash\sessiontemporarily store messages in session, messages can printed in next request
Comments
Post a Comment