-2

Full example of how to use Zend Framework 2 Session in Controllers, and display the session variable to the view (.phtml).

dixromos98
  • 756
  • 5
  • 18
Igor
  • 11
  • 3

1 Answers1

0

I guess the links below would be a good starting point.

Links:

Using Sessions in Zend Framework 2

Using Sessions In Zend Framework 2 – Part 1

Session Container

update: in your view action inside a controller add them in the ViewModel.

        //session 
        $session = new Container('somecontainer');
        $poster = $session->somename;//$session->somename holds data set from another action

        $view = new ViewModel(array(
            'poster' => $poster,

        ));
        return $view;

and inside the view depending on the type of the variable you use it

echo $poster;//will echo the session message.
dixromos98
  • 756
  • 5
  • 18