Full example of how to use Zend Framework 2 Session in Controllers, and display the session variable to the view (.phtml).
Asked
Active
Viewed 834 times
-2
-
1Have you tried google.com? – peterpeterson Jul 31 '14 at 09:15
-
there are just parts of using Zend Session. – Igor Jul 31 '14 at 09:21
1 Answers
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
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
-
Already got through this links.But how to use session variables in view files? – Igor Jul 31 '14 at 09:22
-
I will implement this type and also found some books. Will search also through them. – Igor Jul 31 '14 at 09:55