December 2001
Intermediate to advanced
520 pages
13h 42m
English
There is a way in PHP 4 (not available in version 3) to make use of a class's method without having to create an instance of the class. This can be useful if there is a function you would like to use, but you do not need the whole class that the function is in. The syntax for doing this (assuming a class called ClassName contains a method named Method) is:
ClassName::Method();
As an example of this, you'll use the DetermineLinks() function to create a site map page, without creating an instance of HtmlNavTemplate—the class that defines the DetermineLinks() method.
1. |
Create a new PHP document in your text editor (Script 2.12).
<?php Script 2.12. The sitemap.php script makes ... |
Read now
Unlock full access