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

Customize default flash options

$di->set('flash', function () {
    $flash = new FlashDirect(
        array(
            'error'   => 'alert alert-danger',
            'success' => 'alert alert-success',
            'notice'  => 'alert alert-info',
            'warning' => 'alert alert-warning'
        )
    );

    return $flash;
});

I'm using flash with customized. I need to modify delimeter (p), icon (type based icons) and custom button inside (link, close button).

How can i customize default flash options ?

edited Mar '16

Create a new CustomFlash class extends Flash make your customize and set $di->set('flash', function(){return new CustomFlash()});



58.1k
Accepted
answer

Thanks for solution.

I solved with getMessages() method of Phalcon\Flash\Session

Create a new CustomFlash class extends Flash make your customize and set $di->set('flash', function(){return new CustomFlash()});