wal*_*ili 8 router symfony twig
我正在用symfony3开发一个应用程序.
我想在树枝上得到路线名称.我这样做了:
{% set current_path = path(app.request.get('_route')) %}
{{ current_path }}
Run Code Online (Sandbox Code Playgroud)
它显示当前页面的URL.但我想得到的路线名称不是路径.
example :
personnel_index:
path: /liste
defaults: { _controller: "PersonnelBundle:Personnel:index" }
methods: GET
must return : personnel_index
Run Code Online (Sandbox Code Playgroud)
那么我怎样才能获得路线名称
Con*_*tin 33
这是因为你把路径功能试试这样
{% set current_path = app.request.get('_route') %}
{{ current_path }}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19234 次 |
| 最近记录: |