internalData = $subject->getData();
}
}
class BasicWidget extends Widget {
function __construct() {
}
public function draw() {
$html = "
";
$html .= "
Instrument Info |
";
$numRecords = count($this->internalData[0]);
for($i = 0; $i < $numRecords; $i++) {
$instms = $this->internalData[0];
$prices = $this->internalData[1];
$years = $this->internalData[2];
$html .= "$instms[$i] | $prices[$i] |
$years[$i] |
";
}
$html .= "
";
echo $html;
}
}
class FancyWidget extends Widget {
function __construct() {
}
public function draw() {
$html =
"
Our Latest Prices
|
instrument |
price | date issued
|
";
$numRecords = count($this->internalData[0]);
for($i = 0; $i < $numRecords; $i++) {
$instms = $this->internalData[0];
$prices = $this->internalData[1];
$years = $this->internalData[2];
$html .=
"$instms[$i] |
$prices[$i] | $years[$i]
|
";
}
$html .= "
";
echo $html;
}
}
?>