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

Trouble with clickable link inside Flash Message

HI, I have a trouble with putting clickable link inside Flash Message, it keep showing raw html tag inside message instead of render into html

Please verify your email, please <a href="#">click here</a> to resend verify link

"click here" should be clickable



93.7k
Accepted
answer

Try like this in your service file:

        // Flash messages
        $di->setShared('flash', function() {
            $flash = new \Phalcon\Flash\Session();
            $flash->setAutomaticHtml(false);
            $flash->setAutoescape(false); // This is important part
            return $flash;
        });

Thank you bro, you saved my day ^^

Try like this in your service file:

       // Flash messages
       $di->setShared('flash', function() {
           $flash = new \Phalcon\Flash\Session();
           $flash->setAutomaticHtml(false);
           $flash->setAutoescape(false); // This is important part
           return $flash;
       });