(FREE!) Why using global variables is dangerous, and how Http Foundation solves this problem and allows for extending functionality - 1:56
In this video we talk a bit about how the Request and response wrappers give us more flexibility than accessing our GET and SERVER variables globally, and what the dangers are of using global variables are.
Examples of how we can use the Request class to access variables, and what a reverse proxy is - 7:04
After seeing a simple example of using the Request class, we dig deeper and other things we can do with the Request class, including simulating a request (which is actually pretty neat).
Examples of using the Response class to set status codes, content and content type headers - 3:04
In this video we dig into the Response class and demonstrate how to set a 404 status code and modify the content type header. This might sound a bit dry if you’ve never had to set status codes before, but if you have you’ll notice how concise and simple the Symfony code is.
Adding a second page and an include file for common code - 3:37
Our application is pretty simple so far, and in this video we look at what adding another file would change, and how we can share code between our pages by using an include file. This is a common solution as you start to look at adding flexibility to your code, but we’ll soon identify its weaknesses too.
How to add a front controller - 4:07
We explored using a front controller in our PHP Programming Basics collection, but here we do a quick review and illustrate the pieces we need to route every request to our application through a single file, instead of relying on naming our page files in a particular way.