I am trying to create custom MVC framework in PHP. I am just starting with this MVC and framework stuff and I am not very good.
I made all the normal stuff. The library for model, controller, and view and I found a general app up and running.
I want to include some error handling now. Mainly on the user side for the bad url I did not find the page or want to make 404 errors, so I need a way to check bad controllers, tasks and query strings. And then send users to a 404 page.
This is a learning based project that is not for production.
Is this the best practice to do in any MVC environment?
Edit >
Firstly, if you are planning to produce it If not, the custom framework itself is not recommended to be developed. There are many great frameworks that you can use with more flexibility and more importantly with more performance.
The problem is that first write a custom exception handle for managing 404. I advise them to call your system / core class where you create the controller's object and start the action, if they do not exist.
Comments
Post a Comment