scalaplayframeworkwebjarstwirl

webjars-play: How to use WebJarsUtil in Play 2.7


After migrating to Play 2.7.0-RC3 I get the following Compile Exception:

value css is not a member of org.webjars.play.WebJarsUtil

I use this in the Twirl-Template like:

// inject
@this(webJarsUtil: org.webjars.play.WebJarsUtil)
...
@Html(webJarsUtil.css("dataTables.semanticui.min.css"))
...

How do I have to use this with Play 2.7?


Solution

  • After checking the Unit test, I figured it out:

    // inject
    @this(webJarsUtil: org.webjars.play.WebJarsUtil)
    ...
    @webJarsUtil.locate("dataTables.semanticui.min.css").css()
    ...
    

    This also worked for the scripts:

    @webJarsUtil.locate("jquery.dataTables.min.js").script()