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(); } } ?> Link to comment https://forums.phpfreaks.com/topic/78017-page-class-check-it-out/ 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']; ?> Link to comment https://forums.phpfreaks.com/topic/78017-page-class-check-it-out/#findComment-394883 Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 what does your classes do? Link to comment https://forums.phpfreaks.com/topic/78017-page-class-check-it-out/#findComment-394920 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. Link to comment https://forums.phpfreaks.com/topic/78017-page-class-check-it-out/#findComment-394930 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.