I’ve worked with Java EE recently and like the idea of struts.xml where I can handle the redirection to pages based on return string from action classes.
In PHP, in my new under-development site, I am trying to follow the MVC standards without an MVC framework used from the internet. So I create the controllers, models and views (empty now). The only thing I am really stuck at is when I submit the form in view (insert_product.php) then I will need to create another php page to handle the post data and pass them to controllers.
Anyway of avoiding creating those pages and maybe having something like struts.xml? Even if I can post data directly to controller class, that would be good.
The request cycle is:
As you see, the MVC separation is entirely a code organization strategy on the server side. You do not need separate files. Any GET or POST request is handled by a controller, the view is just returning a response (i.e. HTML). How the controller handles incoming requests and which controller handles which requests is entirely up to you, it has nothing to do with any particular files.