Advanced PHP: objects, MVC and web services
Structure a professional PHP application: MVC architecture, PDO, ORM, REST services and best practices.
- 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
Objects in PHP: going deeper
- Classes, interfaces and traits
- Abstract classes and polymorphism
- Magic methods
- Strong typing and enums
- Exception handling
Design principles
- Single responsibility and loose coupling
- Dependency injection
- Common design patterns in PHP
- Composer and PSR-4 autoloading
- Reviewing legacy code
Turn a procedural script into classes.
Namespaces and MVC architecture
- Namespaces and folder organization
- Controllers, models and views
- Router and front controller
- Templates
- Configuration management
Build a small MVC core step by step.
Forms and validation
- Centralized validation
- Error messages and reusable forms
- CSRF protection
- Handling uploaded files
- Manual and automated tests
Data access with PDO
- Abstraction layer with PDO
- Repositories
- Transactions and error handling
- Complex queries and joins
- Performance: indexes and N+1 queries
Write repositories for the project's entities.
Discovering an ORM
- Principle of object-relational mapping
- Entities, annotations and attributes
- Relations between entities
- Queries with the ORM
- Migrations
ORM: practical cases
- Custom repositories
- Collection handling
- Lifecycle events
- Test datasets
- PDO / ORM comparison
Model a business domain with the ORM.
Web services: REST and other formats
- REST principles
- Designing endpoints
- JSON serialization
- API authentication
- Overview of SOAP and JSON-RPC
Expose the project's entities as a REST API.
Security and debugging
- SQL injection, XSS and CSRF
- Password and session management
- Debugging with Xdebug
- Logging
- Security checklist
Third-party libraries, AI and finalization
- PDF generation and image manipulation
- Sending emails
- AI assistants to generate and review code
- Deployment best practices
- Final project review
Present and defend the project's technical choices.
Tools and technologies
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.

