Rendering flow
The Magento application entry point is its index.php
file. All of the HTTP requests go through it.
Let's analyze the (trimmed) version of the index.php
file as follows:
//PART-1-1 require __DIR__ . '/app/bootstrap.php'; //PART-1-2 $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); //PART-1-3 $app = $bootstrap-> createApplication('Magento\Framework\App\Http'); //PART-1-4 $bootstrap->run($app);
PART-1-1
of the preceding code simply includes /app/bootstrap.php
into the code. What happens inside the bootstrap is the inclusion of app/autoload.php
and app/functions.php
. The functions file contains a single __()
function, used for translation purposes, returning an instance of the \Magento\Framework\Phrase
object. Without going into the details of the auto-load file, it is suffice to say it handles the auto-loading of all our class files across Magento.
PART-1-2
is simply a static create method call to obtain the instance of the \Magento\Framework\App\Bootstrap...