Reputation: 3401
I have a question regarding the Leaf template engine.
How can I access the Session values in the Leaf Template? For instance to loop through Flash messages like in Laravel: https://laravel.com/docs/5.3/redirects#redirecting-with-flashed-session-data
I can't find a solution to accomplish this.
Thanks in advance
Upvotes: 1
Views: 258
Reputation: 3598
The latest version of Vapor includes the request
by default when rendering views. Therefore you'll be able to access the session using
#(request.session) // in the latest version of Vapor
Upvotes: 2