Back-end & frameworks

Advanced PHP: objects, MVC and web services

Structure a professional PHP application: MVC architecture, PDO, ORM, REST services and best practices.

Request this program
Duration
35 h · 5 days
Level
Intermediate
Format
On site · Remote · Blended
Max. group size
12 participants

Overview

This program guides PHP developers towards a professional architecture. Participants deepen object-oriented programming, organize code in MVC with namespaces, abstract data access with PDO and then an ORM, and expose web services. The last day covers security, debugging, third-party libraries and the help provided by AI.

Who this program is for

  • Working PHP developers
  • Developers preparing to move to a framework
  • Teams refactoring a legacy application

Prerequisites

  • Practice of PHP basics
  • Notions of SQL

Learning objectives

  • Design well-structured classes in PHP
  • Organize an application in MVC with namespaces and autoloading
  • Use PDO and an ORM to map objects
  • Create and consume REST web services
  • Secure and debug an application
  • Use Composer and third-party libraries

Detailed curriculum

10 modules · 35 h · 5 days

Day 1
Objects in PHP: going deeper3.5 h
50% theory · 50% practice
  • Classes, interfaces and traits
  • Abstract classes and polymorphism
  • Magic methods
  • Strong typing and enums
  • Exception handling
Design principles3.5 h🛠 1 workshop
30% theory · 70% practice
  • Single responsibility and loose coupling
  • Dependency injection
  • Common design patterns in PHP
  • Composer and PSR-4 autoloading
  • Reviewing legacy code
🛠 Hands-on workshops
Refactoring1.5 h

Turn a procedural script into classes.

✅ Deliverable : Object-oriented code
Day 2
Namespaces and MVC architecture3.5 h🛠 1 workshop
30% theory · 70% practice
  • Namespaces and folder organization
  • Controllers, models and views
  • Router and front controller
  • Templates
  • Configuration management
🛠 Hands-on workshops
MVC micro-framework2 h

Build a small MVC core step by step.

✅ Deliverable : A working MVC core
Forms and validation3.5 h
50% theory · 50% practice
  • Centralized validation
  • Error messages and reusable forms
  • CSRF protection
  • Handling uploaded files
  • Manual and automated tests
Day 3
Data access with PDO3.5 h🛠 1 workshop
30% theory · 70% practice
  • Abstraction layer with PDO
  • Repositories
  • Transactions and error handling
  • Complex queries and joins
  • Performance: indexes and N+1 queries
🛠 Hands-on workshops
Persistence layer1.5 h

Write repositories for the project's entities.

✅ Deliverable : Tested repositories
Discovering an ORM3.5 h
50% theory · 50% practice
  • Principle of object-relational mapping
  • Entities, annotations and attributes
  • Relations between entities
  • Queries with the ORM
  • Migrations
Day 4
ORM: practical cases3.5 h🛠 1 workshop
30% theory · 70% practice
  • Custom repositories
  • Collection handling
  • Lifecycle events
  • Test datasets
  • PDO / ORM comparison
🛠 Hands-on workshops
Model a domain2 h

Model a business domain with the ORM.

✅ Deliverable : A complete data model
Web services: REST and other formats3.5 h🛠 1 workshop
30% theory · 70% practice
  • REST principles
  • Designing endpoints
  • JSON serialization
  • API authentication
  • Overview of SOAP and JSON-RPC
🛠 Hands-on workshops
Resource API1.5 h

Expose the project's entities as a REST API.

✅ Deliverable : A documented API
Day 5
Security and debugging3.5 h
50% theory · 50% practice
  • SQL injection, XSS and CSRF
  • Password and session management
  • Debugging with Xdebug
  • Logging
  • Security checklist
Third-party libraries, AI and finalization3.5 h🛠 1 workshop
30% theory · 70% practice
  • PDF generation and image manipulation
  • Sending emails
  • AI assistants to generate and review code
  • Deployment best practices
  • Final project review
🛠 Hands-on workshops
Project defense1.5 h

Present and defend the project's technical choices.

✅ Deliverable : A presented application

Tools and technologies

ComposerDoctrine ORMMySQLPHPPostmanVisual Studio Code

Teaching methods

  • Alternating short lectures and hands-on work
  • Live demonstrations by the trainer
  • Capstone project built throughout the modules
  • Group corrections and discussion of best practices

Assessment

  • Hands-on exercises corrected in each module
  • Mini-project completed at the end of the course
  • Knowledge-check quiz

Required equipment

  • A computer with an internet connection
  • A local PHP/MySQL server and Composer installed

Resources provided

  • Course materials and repository of corrected exercises

Career outcomes

  • A clean, home-made MVC application
  • The foundations to understand modern frameworks
  • A REST API in PHP

Related video courses

My video courses that go with this program, to get ready for the training or to review afterwards. Free with an account.