O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Object Oriented PHP and MVC

Video Description

Learn to build a custom object-oriented PHP MVC framework and application

About This Video

  • The course is constructed to explain the fundamental principles required to build a customized framework with object-oriented PHP.
  • Clear, precise and thorough methodologies to of explain the concepts and take you through the process of building the application

In Detail

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 lighter. This framework is completely open source, and you are free to change the name, add elements, and use it as your own in your own projects.

This framework will include: -

  • A core library class to load controllers and 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.

We will not only create the framework, but will build an application on top of it called SharePosts which will comprise something akin to 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 deploy the application to the internet. This is not a beginner PHP course. To learn the basics, please check out the PHP Front To Back series on YouTube by Traversy Media.

Downloading the example code for this course: You can download the example code files for this course on GitHub at the following link: https://github.com/PacktPublishing/Object-Oriented-PHP-and-MVC. If you require support please email: customercare@packt.com

Table of Contents

  1. Chapter 1 : Course Intro & Setup
    1. Welcome To the Course 00:06:12
    2. Project Files & Questions 00:01:00
    3. XAMPP Environment Setup 00:08:32
  2. Chapter 2 : Intro to OOP PHP
    1. About This Section 00:01:10
    2. What Is OOP? 00:05:48
    3. Classes, Properties & Methods 00:09:45
    4. The Constructor & Destructor 00:10:39
    5. Access Modifiers, Getters & Setters 00:09:18
    6. Class Inheritance 00:06:51
    7. Static Methods & Properties 00:06:00
  3. Chapter 3 : The Framework [Part 1] - The Core
    1. What Is MVC? 00:04:31
    2. Workflow Explanation 00:07:55
    3. Creating the Folder Structure 00:08:36
    4. Direct Everything Through index.php 00:07:07
    5. Bootstrap File & Core Class 00:10:43
    6. Loading the Controller from the URL 00:12:01
    7. Mapping Methods & Parameters 00:07:56
  4. Chapter 4 : The Framework [Part 2] - MVC Workflow
    1. Base Controller Class 00:07:14
    2. Loading Views 00:06:11
    3. Config File & Uploader 00:07:46
    4. Header & Footer Includes 00:06:31
    5. Aside - PDO Crash Course 00:17:59
    6. The Database Class - Part 1 00:12:52
    7. The Database Class - Part 2 00:16:03
    8. Clean Up 00:05:25
  5. Chapter 5 : The App [1] - Setup & User Authentication
    1. Initial App & Database Setup 00:05:38
    2. Pages, Bootstrap & Navbar 00:12:52
    3. Creating the Users Controller 00:08:51
    4. Register & Login Form Views 00:11:38
    5. Form Validation 00:13:49
    6. User Model & Email Check 00:07:59
    7. User Registration 00:11:16
    8. Custom Flash Messaging 00:15:30
    9. User Login 00:09:26
    10. User Session Data & Logout 00:08:34
  6. Chapter 6 : The App [2] - Posts Functionality
    1. Posts Controller 00:06:53
    2. Posts Access Control 00:04:58
    3. Post Model & Display 00:12:40
    4. Add Post Form 00:08:40
    5. Inserting Posts 00:13:07
    6. Post Show Details Page 00:13:37
    7. Editing Posts 00:09:38
    8. Deleting Posts 00:07:03
  7. Chapter 7 : App Deployment
    1. Deploying Our App 00:12:45