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!
Learn how to take full advantage of the course materials.
Develop code locally by installing the recommended software.
Check you can create code in the localhost web server root.
Configure Apache with a virtual host so you can develop in the root folder without affecting other projects.
How to access the MySQL console on the command line, a option for the following video.
Create the local database that the project will be using.
Write some plain PHP to retrieve some data from the database using PDO.
Add HTML to the code to format the data retrieved from the database.
Learn the fundamentals of the MVC pattern.
Create a class that fits the Model part of the MVC pattern.
Extract out the presentation code to create a view.
Create a class that will serve as the controller part of the MVC pattern.
Put the controller and model classes into folders.
Put the view templates in a folder.
Test your knowledge of the basics of MVC frameworks.
Learn how to add another page to a project that uses a framework.
Send all requests through one PHP script.
Use the query string to select the controller and action.
Create the controller object and run the action method based on variables instead of hardcoded values.
Test your knowledge of controllers in an MVC framework.
Learn how to separate the URL from the filesystem.
Enable URL rewriting in Apache and enable this through .htaccess configuration files.
Add an .htaccess configuration file that sends all requests to the front controller.
Get the value of the URL path in the browser's address bar in the front controller script.
Use segments to get the controller class and action method name from the URL.
Learn the basics of routing and add a Router class.
Build a table containing routes that map URLs to controllers and actions.
Match the incoming URL to a route.
Run the controller and action based on the URL.
Display a message if the URL doesn't match a route.
Learn how PHP autoloading works for classes.
Add a function that will load class files automatically and use it to load the Router class.
Learn how folders work inside an autoloader.
Learn what PHP namespaces are and how they're used.
Put the classes in namespaces and move the class files to the relevant folders.
Include the namespace folder in the autoloader.
Add the framework namespace when loading the controller class.
Learn how namespaces work relative to each other and how to use the root namespace.
How use statements work in PHP.
Learn how patterns will allow us to have more flexible routes.
How regular expressions work.
Use a regular expression to match the URL path.
How to match the start and end of a string using a regular expression.
How to use character sets in a regular expression.
How to manage repetition in regular expressions.
Use a regular expression to match the URL in the Router.
Get the matched URL segments when matching using the regular expression.
Get the matched segments with names instead of numeric indexes.
Use the matched URL segments to run the controller action.
How we can use variables in routes to match any URL segment.
Specify variables in a route.
Process each segment of the URL in turn.
Use a named capture group to get the URL segment value.
Complete the full regular expression to match the whole URL.
Match the URL using the dynamically-generated regular expression.
Match literal strings in the URL path.
Specify another variable in addition to the controller and action in a route.
How to use wildcards and negated character classes in regexes.
Match URL segments that contain any character.
How to use regex shorthand character classes.
Allow regular expressions to be specified for route variables.
Match the URL, ignoring the case.
Match unicode characters from the URL.
Learn how the order of routes makes a difference.
Learn the basics of dispatching and add a class to do it.
Add a method to the Dispatcher class to handle requests.
Optionally pass additional route variables as arguments to the action method.
Get the action argument method names dynamically.
Match the parameters to the required arguments.
Pass the values from the URL to the action argument when calling it.
Using best practices for controller class and action method names.
Change the case of the controller parameter from the URL.
Change the case of the action parameter from the URL.
Add an option to specify the namespace for a controller class.
Learn how views separate presentation code from application code.
Add a render method to the Viewer to display a template.
Extract data into local variables for the view template to display.
Load the template file, running the code within and capturing the output using an output buffer.
Add subfolders to organise the view templates.
Extract shared code out to avoid repetition in view templates.
Add a variable to a shared view.
Add the Viewer class as a dependency of the controller.
Add a model dependency to the controller.
Get the type of the controller dependencies.
Use the type declarations to create the dependencies automatically.
Create a class for the database connection.
Create a model dependency on the database.
Resolve all dependencies automatically.