- Introduction
- The problem with writing web applications: how NOT to structure your code
- The MVC pattern: What it is and how it can help you write better code
- Install a web server, database server and PHP on your computer
- Start writing the framework: Create the folders and configure the web server
- Addendum: Additional configuration for AMPPS on Windows
- MVC concepts
- Create a central entry point to the framework: the front controller
- Configure the web server to have pretty URLs
- Addendum: Possible additional configuration required for the Apache web server
- Create and require (not include) the router class
- Create the routing table in the router, and add some routes
- Match the requested route to the list of routes in the routing table
- Routing and front controller concepts
- Introduction to advanced routing using route variables
- How to do complex string comparisons: an introduction to regular expressions
- Using special characters in regular expressions: advanced pattern matching
- Write even more powerful regular expressions: use character sets and ranges
- Extract parts of strings using regular expression capture groups
- Get the controller and action from a URL with a fixed structure
- Replace parts of strings using regular expressions
- Get the controller and action from a URL with a variable structure
- Add custom variables of any format to the URL
- Regular expressions
- Advanced routing
- Controllers and actions: an introduction
- How to create objects and run methods dynamically
- Dispatch the route: create the controller object and run the action method
- How to better organise your classes by using namespaces
- Class autoloading: load classes automatically without having to require them
- Load classes automatically: add namespaces and an autoload function
- Remove query string variables from the URL before matching to a route
- Pass route parameters from the route to all controllers
- The __call magic method: how to call inaccessible methods in a class
- Action filters: call a method before and after every action in a controller
- Addendum: fix for a potential security bug introduced with the action filters
- Organise controllers in subdirectories: add a route namespace option
- Controllers and actions
- Views: an introduction
- Display a view: create a class to render views and use it in a controller
- Output escaping: what it is, why do it, and how and when to do it
- Pass data from the controller to the view
- Templating engines: what they are and how they can improve your PHP code
- Make views easier to create and maintain: add a template engine
- Addendum: Changes in Twig 2.0
- Addendum: How to easily fix a potential exception when rendering a Twig template
- Remove repetition in the view templates: add a base template to inherit from
- Views
- Install third-party PHP code libraries automatically using Composer
- Installing and using Composer
- Install the template engine library using Composer
- Include all package classes automatically using the Composer autoloader
- Use the Composer autoloader to load the template engine library
- Add your own classes to the Composer autoloader
- Replace the autoload function with the Composer autoloader
- Composer
- Models: an introduction
- Create a database and check you can connect to it from PHP
- An introduction to PDO: why it makes working with databases in PHP easier
- Add a model, get data from the database and display it in a view
- Optimise the database connection: connect only on demand and reuse it
- Erratum: Correction to the Optimise the database connection code
- Models
- Put application configuration settings in a separate file
- How PHP reports problems: errors, exceptions, and how to handle them
- Handle errors: convert errors to exceptions and add an exception handler
- PHP configuration settings: where to find them and how to change them
- Configure PHP to display error messages
- Show detailed error messages to developers, friendly error messages to users
- Categorise different types of error using HTTP status codes
- Add views to make error pages look nicer in production
- Configuration and error handling
- A brief introduction to some popular frameworks
- Conclusion
- Bonus Lecture: Discounts on other courses