1

Question is how to send to server-side all url-parameters page was viewed by? for example we have url

some.com/app_dev.php/manage/corp/98089459/keyID/2054689/bill/45

and we want to get this ID(s) was used to create route, in our controller (to check data or select from db some things etc.).

First think i thought was parser but don't think is good idea.

Another was to set vars (using twig) it in header at every page

<script>
some = 123;
....
</script>

and use them to send requests (by jquery)... But i think it's bad idea too.. So guys any suggestions?

4

2 回答 2

0

http://api.symfony.com/2.0/Symfony/Component/Routing/Router.html

方法 match() 似乎是最好的解决方案。因此,我们在服务器端调用方法“router->match()”中将当前 url 作为字符串发送,并将获取我们需要的所有数据。

于 2013-05-16T16:14:06.737 回答
0

您也可以使用FOSJsRoutingBundle。请在git-hub中查看

于 2013-05-02T07:22:40.100 回答