We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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?



26.3k

Hi.

You are using Direct flash messages. This class does not have an output() method. Check here: https://docs.phalcon.io/en/latest/api/Phalcon_Flash_Direct.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: https://docs.phalcon.io/en/latest/api/Phalcon_Flash_Session.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