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
https://forums.phpfreaks.com/topic/78017-page-class-check-it-out/
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'];
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.