Here is a sample root class that uses the Bread Crumb module:
require_once(dirname(__FILE__). "/includes/Page.class.php");
class Root extends Page {
function Root {
$this->begin(__FILE__);
$this->Page(dirname(__FILE__));
$this->add_module('Bread_Crumb'); // Set up the Bread_Crumb variables.
$this->set_template('Root.tpl.php');
$this->set_bread_crumb('Home');
$this->end();
}
function set_bread_crumb($title, $url='') {
mod_Bread_Crumb::set_bread_crumb($title, $url);
}
function parse() {
mod_Bread_Crumb::parse();
return parent::parse();
}
}
The index page in that directory will inherit the Root class.
require_once(dirname(__FILE__). "/Root.class.php");
class index extends Root {
function index {
$this->begin(__FILE__);
$this->Root();
$this->set_Template('Content', 'index.tpl.php', true);
$this->set_global_var('PageTitle', 'Welcome to this Website');
$this->set_var('FileContent', 'file.php', true);
$this->parse_var('FileContent');
$this->end();
}
}
$index = new index();
$index->show();
$index->destroy();
|