The application’s foundations
As noted earlier, I will begin with Jaisiel Delance’s PHP implementation of the MVC pattern, whose structure is summarised in the following diagram:

The implementation of the Model-View-Controller pattern is clearly visible.
Let us examine the website’s index.php file:
<?php
try{
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', realpath(dirname(__FILE__)) . DS);
define('APP_PATH', ROOT . 'application' . DS);
require_once APP_PATH . 'Config.php';
require_once APP_PATH . 'Request.php';
require_once APP_PATH . 'Bootstrap.php';
require_once APP_PATH . 'Controller.php';
require_once APP_PATH . 'Model.php';
require_once APP_PATH . 'View.php';
require_once APP_PATH . 'Session.php';
Bootstrap::run(new Request());
}
catch (Exception $e){
$e->getMessage();
}
First, it defines constants that are accessible throughout the application. It then adds further constants from config.php. The require_once statements load the application so that its code is available.
Bootstrap does the work of launching the application. It receives the Request and uses it to instantiate the specified controller, invoking the requested method with the supplied arguments.
URL format in the basic MVC pattern
BASE_URL/controller/method/arg/s
If no method is supplied, index is used. If no controller is supplied, indexController is used.
Bootstrap’s power comes from the following function, whose parameters are provided by the Request:
call_user_func_array(array($controller,$metodo), $args);
When a page is requested, Request assigns its controller, method and arguments, and Bootstrap instantiates the controller.
Following MVC, the controller then accesses the models and passes their data to the views, which produce the Response for the user.
Another difference from more traditional systems is that the entire website always passes through index.php. It acts as a funnel, channelling all the code through a hierarchy. Everything goes through index.
This approach is very practical. Two applications with completely different business models can retain similar file structures, organisation and functions.
Any programmer who understands the pattern will know how the application is organised. The familiar structure greatly reduces the time needed to search the codebase and understand it.
Moreover, a very lightweight foundation of barely 100 lines of code can support reasonably scalable websites.
Taking this concept as the essence of a web application, I will try to extend it to achieve the stated objectives.