Jump to content

PAGE Class Check it out


Cardale

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.