twirl icon indicating copy to clipboard operation
twirl copied to clipboard

Fixed-issue-6573-Include examples of implicit request in documentation

Open Shruti9520 opened this issue 8 years ago • 3 comments

Fixes issue https://github.com/playframework/playframework/issues/6573.

Shruti9520 avatar Oct 02 '17 11:10 Shruti9520

Hi @Shruti9520, thanks for looking at this!

I have a couple of suggestions:

  1. 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.

  2. Instead of saying that an implicit Request is 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).

richdougherty avatar Oct 03 '17 19:10 richdougherty

Hi, @richdougherty

Updated my commit. Thanks for reviewing. :)

Shruti9520 avatar Oct 03 '17 20:10 Shruti9520

@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!

Shruti9520 avatar Oct 04 '17 19:10 Shruti9520