1

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

Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92
Dirk
  • 3,095
  • 4
  • 19
  • 37

1 Answers1

2

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
Gianluca Tranchedone
  • 3,598
  • 1
  • 18
  • 33