@SomeController.staticMethod i want to be do something like
@injectedSomeController.method
package com.example.stuff
object ViewAccessPoint {
private[stuff] val myDaoCache = Application.instanceCache[MyDao]
object Implicits {
implicit def myDao(implicit application: Application): MyDao = myDaoCache(application)
}
}
In your template, you can then access it using
@import com.example.stuff.ViewAccessPoint.Implicits._
myDao.whatever()
@import com.example.SomeController
<p>@SomeController.staticMethod</p>@import java.util.function.Supplier
@(mySupplier: Supplier[String])
<p>mySupplier.get()</p>public F.Promise<Result> foo() {
return F.Promise.promise(() -> myTemplate.render(() -> SomeController.staticMethod))
.map(Results::ok);
} |
Pass it in as a parameter?
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/ff13098b-e049-44d7-a5b0-2c7a64f2fff2%40googlegroups.com.