Write PHP Like a Pro: Build a PHP MVC Framework From Scratch
Write faster, easier to maintain, more secure PHP websites by creating your own Model View Controller framework
Lo que serás capaz de hacer
Most modern PHP development uses a framework like Laravel or CodeIgniter . However, the jump from using basic PHP to using a framework can be difficult . This course bridges that gap . Frameworks can make your PHP projects faster , easier to write and maintain , and more secure . Learn to structure your PHP Code like a professional by building a PHP MVC framework from scratch. Learn how to efficiently organise your code Separate application code (PHP) from presentation code (HTML) Have pretty URLs instead of PHP filenames Develop advanced routing using regular expressions Learn concepts like dependency injection, templating and middleware Use object-oriented (OO) techniques such as inheritance, interfaces, abstract classes and more Develop a full CRUD application using the MVC pattern The essential skills required to understand and use a PHP MVC framework. Developing PHP applications is faster and more secure if you use a framework. Learning how to use an MVC framework puts a very powerful tool at your fingertips. By developing your own from scratch, you'll gain an understanding of just how each component works. Frameworks like Laravel , Symfony and CodeIgniter all use the MVC pattern, so understanding how an MVC framework is put together will give you a strong background to more easily learn frameworks such as these. Content and Overview This course is designed for developers who know PHP but don't know how to use a framework . I designed the course for developers who want to develop full, feature-rich applications quickly and easily. Learning the techniques on this course will enable you to write web applications using the framework you build, but also learn frameworks like Laravel much more easily. Suitable for all PHP developers , you'll start by learning the basics of a PHP MVC framework. You'll learn how to organise your code into models, views and controllers, and how to work efficiently with them. We'll build a full web application from scratch , with each concept explained in detail at every stage. Throughout the course, we'll build code that you can reuse in all your projects. All the source code developed in the lectures is available to download . All the time we'll adhere to industry standards and best practices . When you complete the course you'll be able to use your framework to create fast, flexible web applications, with all the features a modern web application requires. Complete with all the code shown in the lectures, you'll be able to work alongside the instructor and will receive a verifiable certificate of completion upon finishing the course. Also, at all times throughout the course you have access to the instructor in the Q&A section to ask for help with any topic related to the course. Enrol now and become a master of PHP MVC frameworks!
- Efficiently organise your PHP code into models, views and controllers
- Separate application code (PHP) from presentation code (HTML)
- Learn concepts like dependency injection, templating and middleware
- Best practices for handling errors and exceptions in PHP
- How frameworks like Laravel or CodeIgniter work
- Have pretty URLs instead of PHP filenames
Temario
UNIDAD 1 - Introduction and Project Setup · 6 leccionesUNIDAD 1 - Introduction and Project Setup
UNIDAD 1 - Introduction and Project Setup
- Introduction and Welcome: How to Get the Most out of the Course
- Install the Recommended Software
- Develop in the Web Server's Root Folder
- Configure the Web Server to Access the Code using a Virtual Host
- Addendum: Accessing the MySQL Console on the Command Line
- Create a Database in the Local Database Server
UNIDAD 2 - MVC Basics: Models, Views and Controllers · 9 leccionesUNIDAD 2 - MVC Basics: Models, Views and Controllers
UNIDAD 2 - MVC Basics: Models, Views and Controllers
- Retrieve Data from the Database using Plain PHP
- Format the Data Using HTML
- The MVC Pattern: How it Can Help You to Write Better Web Applications
- Adapt Plain PHP Code to Fit the MVC Pattern: Create a Model Class
- Adapt Plain PHP Code to Fit the MVC Pattern: Create a View
- Adapt Plain PHP Code to Fit the MVC Pattern: Create a Controller Class
- Organise Controllers and Models into Folders
- Organise Views into their Own Folder
- MVC Concepts
UNIDAD 3 - Controllers, Actions and the Front Controller · 5 leccionesUNIDAD 3 - Controllers, Actions and the Front Controller
UNIDAD 3 - Controllers, Actions and the Front Controller
- Add Another Page: How NOT to Do it in an MVC Framework
- The Front Controller: Handle All Requests with One Script
- Add Another Controller and Select it in the Front Controller
- Remove Repetition by Dynamically Creating Objects and Running Methods
- Controller Concepts
UNIDAD 4 - Pretty URLs · 5 leccionesUNIDAD 4 - Pretty URLs
UNIDAD 4 - Pretty URLs
- How to have "Pretty" URLs
- Enable URL Rewriting and .htaccess Files
- Add an .htaccess File to Rewrite all URLs to index.php
- Get the Value of the URL Path in the Front Controller
- Remove the Query String and Get the Controller and Action from the URL Path
UNIDAD 5 - An Introduction to Routing · 5 leccionesUNIDAD 5 - An Introduction to Routing
UNIDAD 5 - An Introduction to Routing
- Routes, Routing and the Router: Add a Router Class
- Add the Routing Table and Some Routes
- Match the Route Path to the Routes in the Routing Table
- Use the Controller and Action from the Matched Route
- Show a Message if no Route Matches
UNIDAD 6 - Class Organisation: Autoloading and Namespaces · 9 leccionesUNIDAD 6 - Class Organisation: Autoloading and Namespaces
UNIDAD 6 - Class Organisation: Autoloading and Namespaces
- Class Autoloading: Load Classes Automatically Without Having to Require Them
- Add an Autoload Function and Require the Router Class Automatically
- Try to Load the Controller Class Using the Autoloader
- Namespaces: What They Are and How to Use Them
- Organise Classes in Namespaces and Corresponding Folders
- Change the Autoloader to Include the Namespace
- Load the Controller in its Namespace
- The Root Namespace and Relativity: Load the Model in its Namespace
- Import a Class Into the Current Namespace With a Use Statement
UNIDAD 7 - Advanced Routing using Regular Expressions · 10 leccionesUNIDAD 7 - Advanced Routing using Regular Expressions
UNIDAD 7 - Advanced Routing using Regular Expressions
- Introduction to Advanced Routing: More Flexible Routes Using Patterns
- How to do Complex String Comparisons: An Introduction to Regular Expressions
- Match the URL Path to a Regular Expression
- Using Special Characters in Regular Expressions: Matching the Start and End
- Matching Patterns: Character Sets in Regular Expressions
- Repetition in Regular Expressions
- Match the URL Path to a Pattern Instead of a Fixed String
- Get Segments from the Matched String using Capture Groups
- Use Named Capture Groups to Name the Captured Segments
- Pass the Captured Controller and Action to the Front Controller
UNIDAD 8 - Route Variables: Get Data from the URL Path · 15 leccionesUNIDAD 8 - Route Variables: Get Data from the URL Path
UNIDAD 8 - Route Variables: Get Data from the URL Path
- How to Have More Flexible Routing with Route Variables
- Add a Route with Variables and Make Parameters Optional when Adding a Route
- Process the Route Path One Segment at a Time
- Convert the Segment with a Variable into a Named Capture Group
- Complete the Route-Matching Regular Expression
- Use the Generated Regular Expression to Match the URL Path
- Enable Literal Segments in the Route Paths
- Add a Route with Another Variable
- Wildcards and Negated Character Classes in Regular Expressions
- Match Any Value in the URL Segment for a Route Variable
- Route Variable Patterns and Shorthand Character Classes in Regular Expressions
- Enable Optional Custom Regular Expressions for Route Variables
- Match the URL Path in a Case-insensitive Manner
- Match Unicode Characters in the URL Path
- Add General Routes After More Specific Ones
UNIDAD 9 - Dispatching: Following the Directions from the Router · 10 leccionesUNIDAD 9 - Dispatching: Following the Directions from the Router
UNIDAD 9 - Dispatching: Following the Directions from the Router
- Dispatching: Create a Dispatcher Class and Use it From the Front Controller
- Create a Dispatcher Method to Handle the Request
- Pass Route Variables to the Action Method as Arguments
- Use Reflection to Get the Action Method Argument Names
- Match the Action Method Argument Names to Parameter Values
- Pass the Argument Values to the Action Method
- Allow Multiple-word Controller Classes and Action Method Names
- Convert the Controller Parameter to StudlyCaps
- Convert the Action Parameter to camelCase
- Add a Namespaced Controllers Option
UNIDAD 10 - Views: Present the Data · 7 leccionesUNIDAD 10 - Views: Present the Data
UNIDAD 10 - Views: Present the Data
- An Introduction to Views: Create a Viewer Class
- Add a Render Method and Use it from the Controller
- Pass Optional Data to the View when Rendering it
- Use Output Buffering to Load the Contents of the Template
- Organise View Templates in Subfolders
- Add Shared View Templates for Common Code
- Add a Title Variable to the Shared Header Template
UNIDAD 11 - Dependency Injection (DI) and Autowiring · 7 leccionesUNIDAD 11 - Dependency Injection (DI) and Autowiring
UNIDAD 11 - Dependency Injection (DI) and Autowiring
- An Introduction to Dependency Injection: Inject the Viewer into the Controller
- Inject a Model Object into the Controller
- Use Reflection to Get the Controller Constructor Arguments
- Autowiring: Create the Controller Dependencies from the Type Declarations
- Extract the Database Connection Code out into a Separate Class
- Add a Database Object as a Dependency to the Model
- Create All Dependencies in the Object Graph Using Recursion
UNIDAD 12 - Managing Dependencies with a Service Container · 7 leccionesUNIDAD 12 - Managing Dependencies with a Service Container
UNIDAD 12 - Managing Dependencies with a Service Container
- Remove the Hardcoded Database Connection Credentials
- Create a Container Class and Use it from the Dispatcher
- Add a Registry to the Container and Bind a Value for the Database Class
- Store Closures in the Service Container Instead of Objects
- Output a Message if a Class Cannot Be Created Automatically
- Validate the Type Declarations in the Service Container
- Find Potential Bugs More Easily by Enabling Strict Type Checking
UNIDAD 13 - Error Handling: Exceptions, Environments and HTTP Status Codes · 11 leccionesUNIDAD 13 - Error Handling: Exceptions, Environments and HTTP Status Codes
UNIDAD 13 - Error Handling: Exceptions, Environments and HTTP Status Codes
- Throw an Exception Instead of Using an exit Statement
- Use Standard PHP Library (SPL) Exception Classes to Give More Detail
- Throw a Custom Exception if There is no Match for the URL Path
- Throw an Exception for a Malformed URL
- Toggle the Display of the Exception Details
- Display a Custom View When an Exception Occurs
- Write the Error Details to a Log File on the Server
- Define an Exception Handler to Handle All Exceptions
- Add an Error Handler to Convert Errors to Exceptions
- Return a 200, 404 or 500 HTTP Response Code
- Display a Custom View Template for a Page Not Found Error
UNIDAD 14 - Configuration Settings and Front Controller Organisation · 7 leccionesUNIDAD 14 - Configuration Settings and Front Controller Organisation
UNIDAD 14 - Configuration Settings and Front Controller Organisation
- Move the Error Handler into a Separate Class
- Move the Exception Handler into a Separate Class
- Move the Routes to a Separate Configuration File
- Move the Services to a Separate Configuration File
- Options for Storing Configuration Settings that Change Between Servers
- Create a .env File and a Class to Read its Contents
- Replace Hardcoded Configuration Settings with Those from the .env File
UNIDAD 15 - Security, Static Files and the "public" Folder · 6 leccionesUNIDAD 15 - Security, Static Files and the "public" Folder
UNIDAD 15 - Security, Static Files and the "public" Folder
- Add a Static File and Configure the Framework to Allow Access to It
- Add a "public" Folder and Move Browser-Accessible Files into It
- Make the "public" Folder the Root in the Web Server Configuration
- Add an .htaccess File to Remove "public" from the URL
- Adapt the Framework to Load the Code Outside of the "public" folder
- Load Custom Error Pages from the Correct Folder
UNIDAD 16 - Model Inheritance · 5 leccionesUNIDAD 16 - Model Inheritance
UNIDAD 16 - Model Inheritance
- Display a Single Record Identified by the ID from the URL
- Throw a PageNotFound Exception if the Record isn't Found with the Specified ID
- Add a Base Model Class to Contain Common Functionality
- Add a Property to Replace the Hardcoded Table Name
- Default the Table Name to the Lowercase Model Class Name
UNIDAD 17 - Models: Inserting New Records · 10 leccionesUNIDAD 17 - Models: Inserting New Records
UNIDAD 17 - Models: Inserting New Records
- Add a Form for Creating a New Record
- Insert the New Record Into the Database Using the Model
- Generate the SQL Dynamically Based on the Name and Number of Columns
- Dynamically Bind Values to the Placeholders Based On Their Data Type
- Add a Validation Method to Prevent Empty Records from Being Inserted
- Add Specific Validation Error Messages for Each Field
- Redisplay the Form with the Error Messages for Invalid Data
- Extract out Common Code to the Framework Model Class
- Cache the Database Connection to get the ID of the New Record
- Redirect to the Show Page After Adding a New Record
UNIDAD 18 - Models: Updating and Deleting Existing Records · 9 leccionesUNIDAD 18 - Models: Updating and Deleting Existing Records
UNIDAD 18 - Models: Updating and Deleting Existing Records
- Create a Page for Editing an Existing Record
- Display the Form Containing the Record's Existing Attributes
- Process the Edit Form and Validate the Data
- Redisplay Previous Data when Redisplaying the Form
- Update the Data in the Database Using the Model
- Add a Method to the Controller to Get the Current Record
- Add a Confirmation Page for Deleting an Existing Record
- Add a Model Method to Delete a Record
- Add a Method Specific to a Child Model Class
UNIDAD 19 - HTTP Method-based Routing · 3 leccionesUNIDAD 19 - HTTP Method-based Routing
UNIDAD 19 - HTTP Method-based Routing
- Add a Separate Method to Process the Delete Form Submission
- Replace the Generic Route with an ID with Specific Routes
- Include the HTTP Method When Matching the Route
UNIDAD 20 - Requests · 6 leccionesUNIDAD 20 - Requests
UNIDAD 20 - Requests
- Create a Request Class to Encapsulate Global Request Data
- Use the Request Class in the Dispatcher
- Add Other Superglobals to the Request Class
- Inject the Request Object into the Controller and Use it Instead of Superglobals
- Add a Parent Controller Class for All Controllers to Extend
- Add a Property and Setter Method for the Viewer Dependency
UNIDAD 21 - Template Engines Part One: Variables and Control Structures · 7 leccionesUNIDAD 21 - Template Engines Part One: Variables and Control Structures
UNIDAD 21 - Template Engines Part One: Variables and Control Structures
- Create Multiple Viewer Classes to Render Different Types of View Templates
- Create an Interface for Viewer Classes
- Decouple the Dispatcher from the Viewer Class
- Add a Single Template to Render from the New Viewer Class
- Replace PHP Variables with the Alternative Variable Syntax
- Execute the Generated PHP Code and Output It
- Use Alternative Syntax for Control Structures
UNIDAD 22 - Template Engines Part Two: Template Inheritance · 11 leccionesUNIDAD 22 - Template Engines Part Two: Template Inheritance
UNIDAD 22 - Template Engines Part Two: Template Inheritance
- Create a Base Template and Modify the Index Template to Extend It
- Load the Optional Base Template Identified in the Child Template
- Start to Extract the Block Data from the Child Template
- Match Newline Characters and Use Lazy Matching to Extract the Blocks
- Replace Yields in the Base Template with the Corresponding Block
- Change the show Template to Use the Alternative Syntax
- Provide a Default Value when Displaying null Values
- Modify the new and create Templates to Use the Alternative Syntax
- Convert the Shared Form Template to the Alternative Syntax
- Add Functionality to the Template Viewer to Process Included Files
- Change the edit, update and delete Methods to use the Alternative Syntax
UNIDAD 23 - Responses · 7 leccionesUNIDAD 23 - Responses
UNIDAD 23 - Responses
- Add a Response Class and Inject a Response Object Into the Controller
- Add a Body Property to the Response Object and Output It
- Return a Response Object to the Dispatcher from the Controller
- Add a Method to Return a Response Containing a Rendered View
- Change the Other Action Methods to Return a Response
- Add a Method to Redirect from a Controller
- Add a Method to Set the HTTP Response Code
UNIDAD 24 - Middleware · 13 leccionesUNIDAD 24 - Middleware
UNIDAD 24 - Middleware
- An Introduction to Middleware
- Add a Middleware Class that Modifies the Response
- Define an Interface for Handling a Request
- Create a Class to Handle Controller Requests
- Chain the Middleware and the Controller Action Together
- Add a Class to Run the Middleware Pipeline
- Process Middleware Components in a Chain
- Add a Middleware Class that Modifies the Request
- Add a Configuration File to Assign Short Names to Middleware Classes
- Get the Specified Middleware from the Route
- Create the Middleware Objects in the Dispatcher
- Add a Middleware Interface
- Add a Middleware Class that Returns a Redirect Response
UNIDAD 25 - Conclusion · 2 leccionesUNIDAD 25 - Conclusion
UNIDAD 25 - Conclusion
- Conclusion
- Bonus lecture
Tu certificado lo emite la SEP, no solo una plataforma
Al demostrar la competencia recibes un certificado emitido por la Secretaría de Educación Pública a través del Gobierno del Estado de México: un documento oficial que puedes presentar con confianza ante cualquier empleador o institución.
Tu certificado con INEC
- Lo emite la Secretaría de Educación Pública (SEP), a través del Gobierno del Estado de México
- Documento oficial con folio verificable en línea
- Lo otorga la Universidad Tecnológica Fidel Velázquez
Otras plataformas en línea
- Constancia privada emitida por la misma plataforma
- Solo acredita horas cursadas o asistencia
- Sin respaldo de una autoridad educativa
Tu itinerario, de la inscripción al certificado
- 1
Inscripción con pago único
Pagas $2,800 MXN una sola vez y entras de inmediato al curso.
- 2
Estudias a tu ritmo
25 unidades con videos, lecturas y actividades, disponibles 24/7 durante 12 meses.
- 3
Cuestionarios por unidad
2 cuestionarios para comprobar lo aprendido.
- 4
Certificado
Emitido por la SEP a través del Gobierno del Estado de México, con folio verificable.
Un certificado oficial de la SEP
- Emitido por la Secretaría de Educación Pública (SEP), a través del Gobierno del Estado de México. No es una constancia privada: es un documento oficial, y ese respaldo marca la diferencia frente a otras plataformas en línea.
- Contenido impartido por Dave Hollingworth.
- Folio y QR verificables para compartirlo con quien te contrate.
Empieza hoy, a tu ritmo
Un solo pago y acceso inmediato al curso completo durante 12 meses.
- 25 unidades · 192 lecciones · 60 h
- 12 meses de acceso
- 2 cuestionarios de evaluación
- Certificado emitido por la SEP (Gob. del Estado de México) con folio verificable
Sobre tu inscripción
¿Cómo es el pago?
Un solo pago de $2,800 MXN. No hay mensualidades ni cargos recurrentes.
¿Cuánto tiempo tengo acceso?
12 meses desde tu inscripción, 24/7, para avanzar a tu ritmo.
¿Quién imparte el contenido?
El curso es impartido por Dave Hollingworth; INEC gestiona tu inscripción, evaluación y certificado.
¿Qué pasa cuando vence mi acceso?
Puedes renovar tu cuenta tú mismo desde la plataforma, sin trámites ni esperas.


