Den Thu, 16 Oct 2003 01:18:45 -0400. skrev Phil Powell:
However, I cannot still get the values of $graduation_month, etc. I
cannot change showApplicant class no matter what, but I can change the
DropdownGenerator function, how must I do so to make sense?
Why not:
class DropdownGenerator {
var $month = array(
'0' => 'January',
'1' => 'February',
etc..
);
var $day = array(
'0' => 'Monday',
'1' => 'Tuesday',
etc.
);
var $year = array(
'0' => 'xxxx',
'1' => 'yyyy',
etc.
);
var $blah;
function getDropdownGenerator($monthName, $dayName, $yearName) {
$this->blah = array(
$monthName => $month->$monthName,
$dayName => $day->$dayName,
$yearName => $year->$yearName
);
return $this->blah;
}
}
class ShowApplicant extends DropdownGenerator {
var $graduation_month;
var $graduation_year;
var $graduation_day;
function showApplicant($d = '', $m = '', $y = '') {
$this->graduation_month = $m;
$this->graduation_year = $y;
$this->graduation_day = $d;
}
function setOptions($d, $m, $y) {
$this->graduation_month = $m;
$this->graduation_year = $y;
$this->graduation_day = $d;
}
function getPrint() {
return getDropdownGenerator(
$this->graduation_month,
$this->graduation_day,
$this->graduation_year
);
}
}
$obj = &new ShowApplicant();
$obj->setOptions('1','1','2003');
print_r($obj->getPrint());
Ontested!
--
Hilsen/Sincerely, Michael Rasmussen
En windows admin er en person, for hvem den største bedrift er, at
lave konfiguration af serveren med trial and error via en gui.