Welcome

Step-by-Step Introduction to the [Symfony] Web Framework

created by Anthropic’s AI Claude at the request of Serge Tahé - September 2026


This document is a translation of the original French version, generated using an automated tool. Some expressions or technical terms may not fully reflect the original meaning.

This course shows, step by step, how to build an MVC web application with the Symfony 8.1 framework and PHP 8.4. The HTML pages are generated by the server with Twig views, with no JavaScript framework in the browser, and data access goes through the Doctrine ORM.

It has two parts. First come 28 small examples, each focused on a single concept: routes declared with the #[Route] attribute, controllers, responses, redirects and the service container; argument resolvers and validation constraints; Twig views, layout, macros and extensions, the Form component, the Post / Redirect / Get pattern and CSRF protection; internationalization with YAML dictionaries and ICU messages; data scopes (request, session, cache, cookies); the request life cycle with kernel events and their listeners; firewall, JWT authenticator in a cookie, roles, captcha and rate limiting; and finally a layered web / business / DAO architecture with Doctrine and MySQL.

Then comes a complete case study, RdvMedecins: an appointment-booking application for a medical practice, with three roles (administrator, doctors, patients), available in French and English, in which every file is commented.

Prerequisites: the basics of web programming (HTTP, HTML) and of the PHP language (variables, arrays, functions, classes). The tools used are PHP 8.4, Composer 2, MySQL or MariaDB, Visual Studio Code and curl.

This course belongs to a series that covers the same 28 examples, number by number, with other frameworks: NestJS, ASP.NET Core MVC, Spring MVC, Flask, Laravel and Django. The frameworks can thus be compared example by example, but this course can be read on its own.

All courses by Serge Tahé