热门从symfony2中的URL读取文本?

时间:2015-05-27 10:43:45

标签: symfony

我是这样的网址:

http://local.gogutsi.com/backend/quote/workticket/27119/driver/197?_format=pdf&email_to_driver=1&ret=/backend/quote/workticket/27119/driver/197%3Fret%3D/backend/quote/quotes%253Fquotes_list%255Bstart%255D%253D%2526quotes_list%255Bend%255D%253D

我想从中读取_format值。

1 个答案:

答案 0 :(得分:1)

进入规则url

的控制器
use Symfony\Component\HttpFoundation\Request; 

//class declaration here ...

public function yourControllerNameHere(Request $request)
{   
    //...
    $format = $request->query->get('_format');
    //...
}