我通过ajax GET参数传递,我的url看起来像: example.com/autocamplete?term=string 我为此添加路线: autocomplete: path: /autocomplete?term={term} defaults: { _controller: CatalogWebBundle:Default:autocomplete } 但是我的路线有问题,因为我收到了错误: GET http://127.0.0.1:8000/autocomplete?term=sdfsd 500 (Internal Server Error) 如何重写我的路线到ajax得到拍拍? JS是: $(function() { //autocomplete $(“#search”).autocomplete({ source: “\/autocomplete”, minLength: 1 }); });