Phalcon PhP - flash messages not showing -


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\direct directly outputs messages passed flash.
  • flash\session temporarily store messages in session, messages can printed in next request

Comments