Thank you, i've retrieved the request.
Just to explain better: My project setting are the following: I have two controller HomeController, WidgetController, then i have four page main.scala.html (template) , home.scala.html, index.scala.html and listWidget.scala.html. Then my routes look like:
GET / controllers.HomeController.home
GET /index controllers.WidgetController.index
GET /widgets controllers.WidgetController.listWidgets
POST /widgets controllers.WidgetController.createWidget
My main template it like this:
@(title: String)(content: Html)(implicit request: RequestHeader)
<!DOCTYPE html>
<html lang="en">
<head>
@* Here's where we render the page title `String`. *@
<title>@title</title>
</head>
<body>
<div class="container">
@(request)
@content
</div>
</body>
</html>
the home page looks like:
@(implicit request: RequestHeader)
@main("Welcome to Play") {
<h1>Home</h1>
}(request)
the HomeController looks like :
@Singleton
class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
def home() = Action { implicit request: Request[AnyContent] =>
Ok(views.html.home(request))
}
}
so i have to pass the request in each page i make... it is a smarter way to get the request without modify each page?