Im trying to create an API driven project in symfony2 using FOSRestBundle.
I have an APIController with an action getDataAction().
This works perfectly when i send requests from some external application.I get a JSON encoded data as expected.
But i'll be needing that data in the same application as well(i.e. some other controller within the same application).
Which is an appropriate method of doing this?
- creating object of the
APIControllerand then calling required action on it. OR - or sending a CURL request from the other controller to
getDataAction()of theAPIControllerto get the data.