Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
From Request to Response: A Journey into Drupal 8 Internals
Aug 18, 2015 @ 15:22:33

In a post on the SitePoint PHP blog author Daniel Sipos takes you on a trip through the Drupal 8 execution structure, from request to response, in the internals of the tool.

In the first article on Drupal 8 module development we looked a bit at the routing aspect of this process. We’ve seen that creating pages with paths is now a matter of declaring routes that match up with controllers. The latter, as we’ve seen, can return a render array that gets interpreted into markup and displayed in the main content area of that page. However, did you know that under the hood, Drupal actually transforms that array into a Response object according to the dictates of Symfony’s HTTPKernelInterface?

In this article, I would like us to go deeper into the internals of Drupal 8 (and Symfony2) and look at what actually happens (and can happen) from the moment a request is made by a user to the one in which they see something returned in response.

He starts at the initial point of the request, the front controller, and talks about the creation of the Request instance and it's handling by the HTTPKernel. He moves into the kernel and talks about the events that are triggered during execution and provides an illustration of the flow of the request all the way through to the response. He then "goes deeper" into looking at render arrays and the HTMLRenderer handling to manage the output of the page on the Drupal side.

tagged: request response drupal8 internals symfony httpkernel overview

Link: http://www.sitepoint.com/from-request-to-response-a-journey-into-drupal-8-internals/


Trending Topics: