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.

flashSession is not working in Microframewok

Hi. flashSession is not working in Microframewok? Nothing displays...

services.php

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

index.php

        $app = new Phalcon\Mvc\Micro($di);

        $app->get('/', function () use ($app, $config) {
            $app->flashSession->error('Заполните форму');
            $app->flashSession->output();
            exit;
        });


4.6k

I tried this:

index.php

        $app = new Phalcon\Mvc\Micro($di);

        $app->get('/', function () use ($app, $config) {
            $app->flashSession->error('Заполните форму');
            echo $app['view']->render('index');
        });

index.phtml

<?=$this->flashSession->output();?>

it also does not work



64.0k
Accepted
answer

i think you needed to register session service also ( i am probably wrong but you can give it a try ).



4.6k

I have not activated the service session.. It worked