有没有一种方法可以获取URL所指的模块/动作?
|
在symfony中,是否可以使用一种方法对路由进行反向查找以确定URL指向的模块和操作?
说,类似:
get_module(\"http://host/cars/list\"); // (\"cars\")
get_action(\"http://host/frontend_dev.php/cars/list\"); // (\"list\")
请记住,我不想执行简单的字符串黑客操作,因为可能存在一些不太明显的映射:
get_module(\"/\"); // (What this returns is entirely dependent on the configured routes.)
谢谢!
没有找到相关结果
已邀请:
1 个回复
漂汀拦