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.

No styling on flash messages

Hi All,

I am using the phalcon flash messages to display notifications. I have the flash service registered in my application and the error messages display as soon as I do a redirect but there is no styling information.

Here is the code :

    // registering the flash service
    $di->set('flash', function () {
        return new Flash(array(
            'error' => 'alert alert-error',
            'success' => 'alert alert-success',
            'notice' => 'alert alert-info'

    // using the redirect http method to display the error message on the controller    
     $this->flashSession->error("Wrong email/password");
     return $this->response->redirect('login'); 
     // code in view template
         <!-- error messages -->
         <div class="row">
            <?php $this->flashSession->output(); ?>

This is what it produces on my view :

<div class="errorMessage">Wrong email/password combination</div>

As you can see there is no styling. I have the bootrap.css file loaded.

What am I doing wrong?


edited Sep '14

You use the flashSession for your messages but you configured the "basic" flash messenger. Configure the flashSession and I'm sure it will work :)

$this->di->set("flashSession", function () {
            $flashSession = new FlashSession();
                'error' => 'alert alert-danger',
                'success' => 'alert alert-success',
                'notice' => 'alert alert-info'
            return $flashSession;


Hey @skollro it works!! I had to use the namespace like follows :

use Phalcon\Flash\Session as FlashSession;

and after that it worked just fine :)


oh sorry i didn't see that I've used an alias for the namespace, just copied it from a project of mine ;)