The Front Controller

The Front Controller is a software design pattern which provides just a single entrypoint to a web application.

This pattern is used by all of the PHP frameworks that you can think of and provides many benefits, the main ones being:

  • Centralized control
  • System maintainability
  • Configurability


In this recording, I also discuss the setup which I will be using throughout the course. Personally, I will be using a simple Docker configuration but please use whatever works for you if you have a preferred setup.

What I will add is that, when I started working on this, I hadn't already worked out what tech was going to be involved so I started out with Docker just in case I needed any installable tech or non-common PHP extensions.

As it turned out, I kept everything really simple and even the DB is just an sqlite file. SO...if you have PHP and Composer installed on your computer, it's totally possible to complete this course just with PHP's built-in server. Simply run this command and you're up and running:

php -S localhost:8000 public/index.php

If you do want to use the same setup as me, then just copy the docker-compose.yaml file, which is attached to the lesson, into your project root. You will need to have Docker Desktop installed. The command to get things running is docker compose up -d

I won't be covering Docker in any more detail than that but you can learn more about it by enrolling in my Docker course for free here

Complete and Continue  
Discussion

10 comments