Reputation: 13
I have a Phalcon Multimodule App with the following structure:
The backend module is my common logic module. (I think that) I need a Controller in the API to call a Controller inside backend. How can I do that? or is there a better way to access the logic within the backend module from the api module?
I have already tried adding the \AppServer\Backend\Controllers namespace to the loader inside \AppServer\Api\Module->registerAutoloaders(), but when I tried to use it inside \AppServer\Api\Controllers\IndexController->index(), it gives me an error saying it couldn't find the class.
I've read that I should get the processed module from the router, but I don't know how to do that either.
Thanks in advance for your help :)
Upvotes: 0
Views: 2011
Reputation: 5886
Use this structure:
Here is an example application that uses a similar application structure: https://github.com/phalcon/album-o-rama
Upvotes: 1