13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

182 Chapter 6 Object-Oriented <strong>PHP</strong><br />

of its functionality from Page but overrides the parts that need to be different. For the<br />

TLA site, require that the services page include a second navigation bar.The script<br />

shown in Listing 6.3 does this by creating a new class called ServicesPage that inherits<br />

from Page.You provide a new array called $row2buttons that contains the buttons <strong>and</strong><br />

links you want in the second row. Because you want this class to behave in mostly the<br />

same ways, you override only the part you want changed: the Display() operation.<br />

Listing 6.3 services.php— The Services Page Inherits from the Page Class but<br />

Overrides Display() to Alter the Output<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!