Fixed-issue-6573-Include examples of implicit request in documentation#155
Fixed-issue-6573-Include examples of implicit request in documentation#155Shruti9520 wants to merge 1 commit intoplayframework:mainfrom
Conversation
|
Hi @Shruti9520, thanks for looking at this! I have a couple of suggestions:
E.g. |
|
Hi, @richdougherty Updated my commit. |
|
@richdougherty Hi, I think Thanks! |
| You can define implicit parameters for a template too: | ||
|
|
||
| ``` | ||
| @(user: models.User)(implicit requestHeader: RequestHeader, messagesProvider: MessagesProvider) |
There was a problem hiding this comment.
I don't think this example belongs here. This is the Java documentation and you're referencing Scala API classes from Play.
There was a problem hiding this comment.
I'll remove this. But I am not sure which example is correct for Java documentation.
| @(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). |
There was a problem hiding this comment.
This is also referencing the scala documentation.
Fixes issue playframework/playframework#6573.