Object-oriented PHP: Essential Constructs

A start to object-oriented PHP that will take a student from concept to a working form generator application.
Course info
Rating
(154)
Level
Intermediate
Updated
Jul 22, 2015
Duration
2h 2m
Table of contents
Description
Course info
Rating
(154)
Level
Intermediate
Updated
Jul 22, 2015
Duration
2h 2m
Description

A tour of object-oriented constructs in the PHP language including classes, objects, properties, and methods. The course details the construction of objects and how to use them to contain and define real software models. A form generator application is included that generates a form, receives the request with form data, processes the form data by passing it through a series of validation classes, finally returning a response. The complete request/response cycle is walked through.

About the author
About the author

Daryl Wood is a certified software engineer and architect, web technology consultant, instructor, and author. He is the CTO of Datashuttle.net, Inc., a web services company. He has authored training content in WAMP and MAMP servers, Linux Mint, and Apache mod_rewrite. He gets a kick out of working with students and software engineers, they are the coolest people he says.

More from the author
Section Introduction Transcripts
Section Introduction Transcripts

Essential Constructs
Hello. Welcome to Object-Oriented PHP. In this session, Essential Constructs. My name is Daryl Wood. My Twitter handle is @datashuttle, website datashuttle. net and my LinkedIn address is below that. This course is going to focus on Object-Oriented PHP. There are knowledge requirements necessary to understand the course content. Also there are a few software installs that are necessary to execute the code examples and we'll assume that you have those in place. We'll also set a few goals for each session as we move forward. Knowledge requirements for this course include basic language data types, scalars, arrays, null, and resources; operators and their precedence order; a full understanding of PHP control statements including if and switch constructs; looping with the for loop constructions; function and function scoping, passing parameters, and returning values, and passing values by reference. Software requirements include the PHP interpreter installed either as a web server module or as a stand-alone interpreter often referred to as the command line interface version. If your PHP installed version is a web server module, then I will assume you have a working web server. For writing code, an integrated development environment tailored for PHP is the very best and I'm using PHP Storm for these sessions, or at least a very good text editor.

Static Class, Properties, and Methods
Hello and welcome to a learning module on the PHP Static Class, Properties and Methods. My name is Daryl Wood. I can be reached via my Twitter handle @datashuttle or my web address at datashuttle. net. My LinkedIn URL is shown below. We now know that objects are a dynamic instance of a class declaration. They are object instances with unique properties that differentiate from one object to another. This enables our ability to use objects to represent real things and directly model our domains. So objects are terrific and will serve the bulk of our use cases; however, there's another way to use the class construct for those use cases where we just don't need an object, but could really use the naming protection a class construct provides. This module will discuss the static keyword and its use with class properties and methods. We will then take a look at the static scope, the scope resolution operator and its use for accessing static properties and methods. We will also look at best practices and a few concerns related to static use cases.

Form Generator: Putting It All Together
Have you ever wondered how all of this fits together? From code organization to application level design patterns? Well, welcome to a learning module on the form generator application with what we've learned so far. Hello. I'm Daryl and I will be your guide to the big picture. I've been looking forward to this so let's put some of this stuff to practice. We will start off with the big picture perspective and then do a series of deep dives in and out of the code with descriptions and content analysis. Then we will step through the application as it is now built. One thing to keep in mind, however; this is a single implementation of a simple application and should not be considered the de facto standard on how to organize an application. It's just one way to do it, but it uses the concepts of MVC well. First out of the gate is application flow. A 10, 000 foot view of the in and out and the up and down. Then we will go through a series of class deep dives and look through other important files and see the relative relationship to the application as a whole. Then I'll do a high-level overview of the model view controller design pattern, which the form generator is modeled after. I'll intro the controller, model, and view layers, and throw in some best practices where beneficial.