Fatal error: Call to undefined method Phalcon\Flash\Direct::output()

This code:

<?php echo $this->flash->output(); ?>

is giving me this error:

Fatal error: Call to undefined method Phalcon\Flash\Direct::output()

What is that?



16.4k

Hi.

You are using Direct flash messages. This class does not have an output() method. Check here: http://docs.phalconphp.com/en/latest/api/Phalcon%5Flash%5Direct.html. There are 6 methods you can output message but unfortunetly not output().

On the other hand output() method exist in Session flash class Phalcon\Flash\Session: http://docs.phalconphp.com/en/latest/api/Phalcon%5Flash%5Session.html.

If you set the Flash message in your controller, just add getContent() to your view and it will show it using "direct" version as Conradaek pointed out