Search code examples
phpangularjssymfonyfosrestbundlejmsserializerbundle

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.

{"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. There is not such adds class having disclosuers method.

If FOSRestBundle is used, will it carry any different mechanism? I searched for adds/disclosuers all over the project. but I see it only in one Angular JS file where the POST URL is mentioned.

I am clueless.


Solution

  • Use debug to debug your router.

    app/console debug:router will show you the list of registered routes

    app/console debug:router ROUTE_NAME will show you details of specific route including controller attached to this route