我的Controller中有一个创建搜索过滤器的功能。搜索参数是从我的Twig模板的选择字段中获得的。选定的选项被传递给Controller,以查看具有该值的结果。查询结果以JSON格式返回。publicfunctioncategoryAction(Request$request){$em=$this->getDoctrine()->getManager();$category=$request->request->get('category');$contentCategory=$em->getRepository('PublicartelAppBundle:Content')-