Extending the Display7:40 with Alena Holligan
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
You need to sign up for Treehouse in order to download course files.Sign up