Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Once we create an object, we can access its properties. Getting or setting an object's properties can be done in a number of ways. In this video, we’ll be looking at the most direct way.
Object-Operators
Object-Operators allow us to access the properties and methods of a class. We reference the object name, the object-operator, and finally the property name. The object-operator consists of the characters dash and greater than, which together make a single arrow (->).
$recipe->source = "Grandma Holligan";
Note that the property name does not start with the $ sign; only the object name starts with a $, because this entire reference is one variable.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up