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
We're going to add some finishing touches to the display of our directory.
Declaring class properties or methods as static makes them accessible without needing an instantiation of the class. A property declared as static cannot be accessed with an instantiated class object. Because static methods are callable without an instance of the object created, the pseudo-variable $this is not available inside the method declared as static. Instead they use a keyword (e.g. self, parent and static).
Static methods cannot be overridden.
To learn more about the keyword differences, check out Late Static Binding.
For a refresher on "switch statements" check out the course PHP Arrays and Control Structures: Feature Switch This Week. Or check out the documentation for switch
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