Cardale Posted November 20, 2007 Share Posted November 20, 2007 I know this is pretty basic, but what can I do to bring it more up to date or make it better? I plan on hopefully making it easy to drop in some code on a page and make that the content and its finished. <?php class PAGE extends TEMPLATE{ var $page = array(); var $header; var $content; var $footer; function __construct(){ $this->page = $page; $this->header = $header; $this->content = $content; $this->footer = $footer; } function __destruct(){ } function TITLE($page){ $this->page = $page; } function HEADER(){ include $locate['ROOT_HEADER']; } function CONTENT(){ } function FOOTER(){ include $locate['ROOT_FOOTER']; } function PAGE(){ $this->TITLE($page); $this->HEADER(); $this->CONTENT(); $this->FOOTER(); } } ?> Quote Link to comment Share on other sites More sharing options...
Cardale Posted November 20, 2007 Author Share Posted November 20, 2007 I'm trying to figure out if this is even necessary I could just do this, but I'm trying to make up reason why using a page object would be more efficient. Here is what I use now. <?php include 'root.php'; include $locate['ROOT_HEADER']; $TEMPLATE->set_filenames(array('index' => $locate['INDEX_TPL'])); $TEMPLATE->loadfile('index'); $t_ = array( 'TEST' => $lang['New_pm'] = $LANGUAGE->LANG_HANDLE($lang, 'New_pm', $num) ); // Try diffirent no other than 5 ! for($no = 0; $no < 6; $no++) { $TEMPLATE->assign_block_vars('cell', array( 'NUMBER' => $no, ) ); } $TEMPLATE->assign_vars($t_); $TEMPLATE->pparse('index'); include $locate['ROOT_FOOTER']; ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 what does your classes do? Quote Link to comment Share on other sites More sharing options...
Cardale Posted November 20, 2007 Author Share Posted November 20, 2007 The page class generates the page in the shape I want and the template class converts tpl files and tpl styple tags {TAG} tags. Thats pretty much as far as I've gotten I just wanted to compare the two and see if it was worth making the class. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.