How to use controller route defined by subcut in the template

自古美人都是妖i 提交于 2019-12-25 16:00:10

问题


I have a route defined as @com.xyx.abc(str: String) in my routes file.

I want to use this route in a template. I tried using

<a href="@com.xyx.abc("temp")/>

Obviously didn't work.

Thanks in advance.


回答1:


Reverse routers are generated per package. So, if you have a package called com, a controller called xyx and a method called abc, then you can do this:

@com.routes.xyx.abc("temp")

Or if it's a more realistic @com.example.MyController.abc(str: String), then it would be:

@com.example.routes.MyController.abc("temp")


来源:https://stackoverflow.com/questions/26247312/how-to-use-controller-route-defined-by-subcut-in-the-template

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