I am building a new system fra the bottom and up. And I am in the need of restful services, internal services, admin-interfaces etc.
I am starting to understand how Yii2 works and it looks very promising for the project I am building. But there are still a few things I need to have clarified.
I do understand how restful works. There are very good examples of that. And I know how the MVC works. Also good examples.
How would you guys handle the architecture of an application that have both restful services and actions on the same resource? As I understand Yii2, it will give a lot of methods on the controllers, if I need both web-pages and restful services in the same controller.
Usign Yii2 Advanced template, you have many different application that can share same business logic code.
So you will have backend application where you can put controllers and views for administrator; that you will have an application that will work as restful service, with controllers for exposed interfaces, and so on.
Yii2 is well structured to have multiple application that can share same business login (models, components, etc… etc…).
Havent thought of that. When I read your answer, it was líke … doooh … of course.
But I still have some challenges. The project is going to live in a hosted environment, so I have only one domain active. And I havent read anything on that part yet.
Of what I have understood of applications, its like -> application = domain.
Have I understood that correctly?
If so, then I still dont know how to structure. Guess I need to read up on the application documentatiton.
I am planning to use extensions for my development so much of the code will be in there.
Basically I am thinking of using 1 extension to handle all the controllers for restful services and let this extension be the base for models and migrations. Then 1 more extension to handle the webpages. I would gladly have all the views/pages in the same extension as the restful services, but it would give a myriad of controllers hence my question earliere in this thread.