Symfony 5:如何从路由规则中获取选项数据
Symfony 5: how to get option data from route rules
我需要将 Options 参数与路线一起添加。我在调用控制器之前在eventListener中有事件,我想根据这个选项修改权限...
我可以列出所有的路由并在其中找到一个选项,但是这样的路由系统会有几百条,想直接在刚刚访问的路由上找到这个。
怎么做?
list all routes
route annotation
超级简单的解决方案,谢谢!
if ($e->getRequest()->get('system') === null) { throw new BadRequestException(...)
我需要将 Options 参数与路线一起添加。我在调用控制器之前在eventListener中有事件,我想根据这个选项修改权限...
我可以列出所有的路由并在其中找到一个选项,但是这样的路由系统会有几百条,想直接在刚刚访问的路由上找到这个。
怎么做?
list all routes
route annotation
超级简单的解决方案,谢谢!
if ($e->getRequest()->get('system') === null) { throw new BadRequestException(...)