professional-php-04-abstract-widget.php / php
<?php interface Observer { public function update(Observable internalData = array(); abstract public function draw(); public function update(Observable this->internalData = html = "<table border=1 width=130>"; <tr><td colspan=3 bgcolor=#cccccc> <b>Instrument Info<b></td></tr>"; numRecords = count(i = 0; numRecords; instms = prices = years = html .= "<tr><td>i]</td><td> i]</td> <td>i]</td></tr>"; } </table><br>"; echo html; } } class FancyWidget extends Widget { function __construct() { } public function draw() { <table border=0 cellpadding=5 width=270 bgcolor=#6699BB> <tr><td colspan=3 bgcolor=#cccccc> <b><span class=blue>Our Latest Prices<span><b> </td></tr> <tr><td><b>instrument</b></td> <td><b>price</b></td><td><b>date issued</b> </td></tr>"; numRecords = count(i = 0; numRecords; instms = prices = years = html .= "<tr><td>i]</td><td> i]</td><td>i] </td></tr>"; } </table><br>"; echo html; } } ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.