[英]how is a REST API is routed to back end controller where FOSRestBundle is used to create services?
Here is a scenario - http://ic.local/api/adds/disclosuers is the URL to create a disclouser and on click of form submit below data gets POST
to the URL. 这是一个场景-http://ic.local/api/adds/disclosuers是创建Disclouser的URL,单击表单提交后,单击下面的数据将获取
POST
到URL。
{"gm_restbundle_tdtlsdisc":{"isClassified":"N","isExportControl":"N","discTitle":"test","firstRecordedDate":"06-December-2016","estimatedTime":"5","shareOutsideGM":"N"}}
But when I look into backend PHP Symfony code I am not able to locate which controller is handling this POST request. 但是当我查看后端PHP Symfony代码时,无法找到哪个控制器正在处理此POST请求。 There is not such
adds
class having disclosuers
method. 没有具有
disclosuers
方法的adds
类。
If FOSRestBundle
is used, will it carry any different mechanism? 如果使用
FOSRestBundle
,它将采用任何其他机制吗? I searched for adds/disclosuers
all over the project. 我在整个项目中搜索
adds/disclosuers
。 but I see it only in one Angular JS file where the POST URL is mentioned. 但我只能在提到POST URL的一个Angular JS文件中看到它。
I am clueless. 我无能为力。
Use debug to debug your router. 使用debug调试路由器。
app/console debug:router
will show you the list of registered routes app/console debug:router
将向您显示已注册路由的列表
app/console debug:router ROUTE_NAME
will show you details of specific route including controller attached to this route app/console debug:router ROUTE_NAME
将向您显示特定路由的详细信息,包括与此路由相连的控制器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.