Hi
maybe my thread title isn't too clear, but I can't get my head round some aspects of classes
basically I have a very simple class that writes a table cell :
class tableCell {
var $html = "";
var $tdClass = "";
function tableCellOut(){
$this->html .= "<td";
if($this->tdClass!=""){
$this->html .= " class=\"".$this->tdClass."\" ";
}
$this->html .= ">";
// I want to insert contents here
$this->html .= "</td>\n";
return $this->html;
}
}
and I call it from my page with
$tC1 = new tableCell;
echo $tC1->tableCellOut();
then I have several classes to write either a clickable icon, a select menu, a clickable text link etc and I want to be able to insert them into the table cell
how do I do this from the page so that when i instantiate the tableCell class i can tell it which class to use for the contents and send some variables to that contents class ?
when i read online tutorials about this it only seems to confuse things more !
thanks