Create Your Own PHP MVC
Code Your Own PHP MVC Framework in 1 Hour MVC architectural pattern M: Model V: View C: Controller The core concept of MVC is to separate business logic from displaying(the View part). First let me explain the whole workflow of an HTTP request & HTTP response. For example, we have a commerce website and we want to add a certain product. A very simple URL would be look like this: http://bestshop.com/index.php?p=admin&c=goods&a=add http://bestshop.com is the domain name or base URL; p=admin means the Platform is admin panel, or the Backend site of the system. We also have a Frontend site, which is public to the world(in this case, it would be p=public) c=goods&a=add means this URL requests the ‘goods’ Controller’s add action method. Front Controller Design Pattern What is index.php in the above example? This file is called ‘Front Controller’ in PHP’s MVC frameworks. The name is usually index.php, but you can name it something else(few people d...