Fixed-issue-6573-Include examples of implicit request in documentation
Fixes issue https://github.com/playframework/playframework/issues/6573.
Hi @Shruti9520, thanks for looking at this!
I have a couple of suggestions:
-
Maybe a good place to mention these implicits is at the end of the Template parameters section of the docs, just before the Template constructor heading.
-
Instead of saying that an implicit
Requestis required, I think we could tell users that it's useful for CSRF and form helpers and include links to the documentation.
E.g.
You can define implicit parameters for a template too:
@(user: models.User)(implicit requestHeader: RequestHeader, messagesProvider: MessagesProvider)
Many template helpers expect an implicit value to be in scope. For example, Cross-Site Request Forgery (CSRF) protection [needs a RequestHeader](ScalaCsrf#Defining-an-implicit-Requests-in-Templates) and Form Helpers [need a MessageProvider](ScalaForms#Passing-MessagesProvider-to-Form-Helpers).
Hi, @richdougherty
Updated my commit. Thanks for reviewing. :)
@richdougherty Hi,
I think ScalaCsrf#Defining-an-implicit-Requests-in-Templates is a kind of an external link. Can I use standard Markdown link syntax here?
Thanks!