Extending a Method4:27 with Alena Holligan
Sometimes you have a method that you want to keep, but you just want to add a little more functionality. Once again, PHP gives us a way to keep the original method while still adding additional code.
The Scope Resolution Operator, the double colon (::), is a token that allows access to static, constant, and overridden properties or methods of a class. You can use this operator when Extending the method of a parent class.
will call the constructor from the parent class. You can then add your own code either before or after the call to the parent method.
You need to sign up for Treehouse in order to download course files.Sign up