-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed-issue-6573-Include examples of implicit request in documentation #155
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also referencing the scala documentation.
Fixes issue playframework/playframework#6573.