Object-Oriented PHP Basics
Treehouse
Course Summary
At a glance, object-oriented programming can appear to be far more complex than simple procedural, or inline, code. However, this doesn’t have to be the case. Because object-oriented programing is similar to the way human beings perceive the real world, using the object-oriented approach, can help you visualize the solution to a problem more easily. Object-oriented programming, or OOP for short, is a style of coding that allows developers to group similar tasks into containers. In PHP, containers are defined using classes. A class contains all the functions and variables that describe an object.
-
+
Course Description
About this Course At a glance, object-oriented programming can appear to be far more complex than simple procedural, or inline, code. However, this doesn’t have to be the case. Because object-oriented programing is similar to the way human beings perceive the real world, using the object-oriented approach, can help you visualize the solution to a problem more easily. Object-oriented programming, or OOP for short, is a style of coding that allows developers to group similar tasks into containers. In PHP, containers are defined using classes. A class contains all the functions and variables that describe an object. What you'll learn
- Terms: class, object, instance, property, method
- Why and when to use OOP
- Static Methods
- Magic Methods and Constants
- Filtering
About the Teacher
When not at her computer, Alena enjoys exploring Portland with her friends and family, including her 3 young children. She also enjoys the Symphony, Cooking, Books, Yarn and Yoga.
-
+
Course Syllabus
Why Object-Oriented Programming?
Object-oriented programming, or OOP for short, is a style of coding that allows developers to group similar tasks into containers. In PHP, containers are defined using classes. A class contains all the functions and variables that describe an object. 5 steps- Introducing the Cookbook Project 3:27
- What is Object-Oriented Programming? 3:20
- What is OOP? 5 questions
- Why Use Object-Oriented Programming? 6:02
- Why Use OOP? 3 questions
Understanding Classes
Object-oriented programming lets us group data as well as functions into a specific topic or piece of functionality. In PHP we call these groupings classes. We'll explore the ways a class allows us to store and retrieve data, as well as to perform actions, or functions, on that data. 9 stepsBuilding the Recipe
To build our recipe class we'll learn to use access modifiers with getters and setters to control access to properties and methods. We'll also see the single responsibility principle in action and create static methods for multiple display options. If that's not enough, we'll also become a magician! 16 stepsBuilding a Collection
Building a collection object allows us to group multiple objects together while adding functionality. We'll be creating our cookbook which will allow us to list recipes, filter recipes and create a shopping list of ingredients. 10 steps