Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

SymfonyCasts

Symfony 5 Deep Dive! The HttpKernel Request-Response Flow

via SymfonyCasts

Overview

Want to see how Symfony really works under-the-hood? Let's do it!

In this tutorial, we'll dive deep: tracing from the first line of code that's executed in public/index.php through the core of Symfony's HttpKernel. It's a daring adventure that includes events, controller resolvers, request attributes, and giant sea monsters... probably:

  • Hooking into Symfony with an event subscriber
  • Finding where the Request is created
  • The all-powerful HttpKernel::handle() method that's used in Symfony AND Drupal!
  • See where the core events like RequestEvent, ControllerEvent and more are dispatched
  • Controller resolver, argument resolver, argument value resolvers oh my!
  • Request attributes: the secret carrier of framework info
  • What is a sub-request?
  • Manually creating and handling sub-requests

By the end of this tutorial, you'll understand how the dots connect deep under the surface of Symfony... making you capable of hooking into just about any part of Symfony. Woh.

Syllabus

  • Events, Events & Events!
  • Hooking into Symfony with an Event Subscriber
  • index.php to HttpKernel::handle()
  • RequestEvent & RouterListener
  • Routing Secrets & Request Attributes
  • The Controller Resolver
  • Who Creates the Controller & Gives it the Container?
  • How does the Controller Access the Container?
  • The Argument Resolver
  • Argument Value Resolvers
  • How Service Autowiring Works in a Controller Method
  • Calling the Controller & View Event
  • kernel.response Event & Request Format
  • Finishing the Request
  • Exception Handling
  • The Critical kernel.exception Event Listeners
  • FlattenException & Error Status Codes
  • Serializer Error Renderer: JSON/XML Errors
  • How the HTML Error Page is Rendered
  • The Magic `_controller` Attribute
  • Custom Global Controller Arguments
  • How Entity Controller Arguments Work
  • Sub Requests
  • Sub Requests & Request Data
  • Manually Making a Sub Request
  • Sub Request Attributes

Taught by

Ryan Weaver

Reviews

Start your review of Symfony 5 Deep Dive! The HttpKernel Request-Response Flow

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.