
Explore the basics of object oriented programming in PHP by defining a user class with properties and methods, instantiating objects, accessing properties, and using this to reference class data.
Explore PHP object oriented concepts by implementing constructors and destructors in a user class, automatically initializing properties, managing object lifecycles, and using magic constants to identify the class.
Explore inheritance in PHP by extending a user class to access protected properties and methods from a customer class. See constructors and parent::__construct used to initialize data.
Explore how an open source mvc framework routes requests via htaccess, loads controllers and methods like index, add, and edit, and passes data to views for a SharesPost app.
Create reusable header and footer includes in a PHP MVC app, wiring header with the site name and CSS, and the footer with main.js via app root and URL route.
Set up the share posts app within the MVC framework, configure the database, and prepare the home view; create the share posts database with users and posts tables.
Create a users controller in an object oriented PHP MVC app, handling register form display and post submission, initializing form data and error variables, and loading the register view.
Create a post model to fetch posts with a join to users for author names, then render posts in index view as bootstrap cards with title, body, and more button.
Implement an edit workflow by reusing the add method, enforce ownership, load current post data, and update via the post model with validation and flash feedback.
Implement delete functionality in a pure PHP MVC app by adding a delete post controller and model, enforcing post requests, flashing 'post removed', and ensuring only the owner can delete.
In this course we will go step by step to build a complete custom MVC (Model View Controller) framework Called TraversyMVC using object oriented PHP. We will build something similar to Codeigniter but much much lighter. This framework is completely open source and you are free to change the name, add stuff, etc and use it as your own. This framework will include...
A core library class to load controllers & methods from the URL (Also using .htaccess)
A base controller class to load models and views
A custom database library using PDO for all models to interact with the database using prepared statements
Not only will we create the framework but we will build an application on top of it called SharePosts which will be somewhat of a social network to share posts. This application will include..
Full user authentication
Access control for posts
Server side form validation
Bootstrap 4 UI
Posts CRUD
Helper functions (flash messaging & redirects)
We will also be deploying the application to the Internet
This is not a beginner PHP course. You should already understand things like variables, arrays, loops, functions and all of the basics of the PHP language. It is ok if you do not understand OOP fully. Before we start the framework project, we will have a crash course on object-oriented programming with PHP, where you will learn about classes, methods, properties and more.
To learn the basics, please check out the PHP Front To Back series on YouTube by Traversy Media