OK, here is the thing
I have a set of class instances $Table->Open(); and $Table->Close();
Now, obviously the open instant OPENS and BEGINS the table code up until where the content is to be placed, and the close instant CLOSES and ENDS the table code after where the content is to be placed. Now, I was thinking, there has GOT to be a way to insert headers and footers through the class, and I figured that I could add variables to the function. So i did.
$Table->Open($Header);
$Table->Close($Footer);
Now my only problem, is that I only want to have headers and footers where I need them, with the current way I have it I need headers and footers EVERYWHERE i insert these two functions, isn there a way to make it an optional field? So that when I dont include it I dont get errors?
class Theme
{
function Open($header){
global $base_url, $user;
define("_TABLE_HEADER", $header);
include($base_url."/Templates/".$user->theme()."/OpenTable.tpl");
}
function Close($footer){
global $base_url, $user;
define("_TABLE_FOOTER", $footer);
include($base_url."/Templates/".$user->theme()."/CloseTable.tpl");
}
}
$Table = new Theme;