Hi .. I want to do something like this
class ttSelectBox
{
var $name; // string
var $onChange; // string
var $optionList; // object
// constructor and other functions
...
function printHtml()
{
print "<select name=\"$this->name\" onChange=\"$this->onChange\">";
$this->optionList->printHtml();
print "</select>";
}
}
Now, OptionList is another object .. and add an optionlist to the selectBox list at some point. I want printHtml to call OptionList's printHtml.
I'm not looking for comments on why I would want to do select elements this way. I want to know if its possible to use objects in this way in PHP. I know I could in Java, but its strongly typed. I think thats why it is not working when I tried it .. unless I am doing it wrong.
Thanks