Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

undefined method Phalcon\Flash\Direct::output()

When I add a css class for flashSession, it shows an error.

$di->set('flashSession', function(){
      return new Phalcon\Flash\Direct(array(
        'error' => 'alert alert-dismissable alert-danger',
        'success' => 'alert alert-dismissable alert-success',
        'notice' => 'alert alert-dismissable alert-info',
      ));
});

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



28.9k
Accepted
answer
edited Mar '14

You did mistake, should be

$di->set(
    'flashSession',
    function () {
        return new Phalcon\Flash\Session(array(
            'error' => 'alert alert-dismissable alert-danger',
            'success' => 'alert alert-dismissable alert-success',
            'notice' => 'alert alert-dismissable alert-info',
        ));
    }
);

or

$di->set(
    'flash',
    function () {
        return new Phalcon\Flash\Direct(array(
            'error' => 'alert alert-dismissable alert-danger',
            'success' => 'alert alert-dismissable alert-success',
            'notice' => 'alert alert-dismissable alert-info',
        ));
    }
);