What is the server side comment tag in scala templates in play framework?

℡╲_俬逩灬. 提交于 2019-12-10 12:32:12

问题


I need to comment my code server side ( not rendered to client) in scala templates in play framework. What is the format of this tag?


回答1:


The documentation does not explicitly say, but as the template engine is inspired by ASP.net Razor, I would guess it uses the same syntax, which is

@* comment here *@

Note the end comment is done with a closing @ symbol.




回答2:


This works:

@{ /* Comment */ }

But I was hoping something even better (requiring less typing) is out there.




回答3:


These two are working for scala-0.9.1 (on play framework):

@{ /* comment */ }

@{ // comment
}

But these not:

@{ // comment }
@* comment *@

Still, there's a lot of typing :(




回答4:


@* comment *@ works in play framework version 2



来源:https://stackoverflow.com/questions/6398059/what-is-the-server-side-comment-tag-in-scala-templates-in-play-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!