So here is my parent:
Code: Select all
<?php
/**
* Description of template
*
* @author Dominic Sore
*/
class template {
public $templateName;
public function setTemplate($lTemplate){
$this->templateName = $lTemplate;
}
public function loadTemplate(){
echo '<link rel="stylesheet" type="text/css" href="template/'.$this->templateName.'/css/'.$this->templateName.'.css" />';
}
}
?>Code: Select all
<?php
/**
* Description of headerProperties
*
* @author Dominic Sore
*/
class headerProperties extends template {
public $title;
public function setTitle($pTitle){
$this->title = $pTitle;
}
public function insTitle(){
echo '<title>'.$this->title.'</title>';
}
public function insMeta(){
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
}
public function createHeader(){
echo '<head>';
$this->insTitle();
$this->insMeta();
parent::loadTemplate();
echo '</head>';
}
}
?>Code: Select all
<?php
/**
* Description of Global_Conf
*
* @author Dominic Sore
*/
class globalConf {
public function __construct() {
/* Require relevant includes */
require_once 'database.php';
require_once 'login.php';
require_once 'template.php';
require_once 'headerProperties.php';
/* Load classes */
$dbConnect = new database();
$logFunc = new login();
$tempProperties = new template();
$headProperties = new headerProperties();
/* Database Functions */
$dbConnect->parseIni();
$dbConnect->dbConnect();
/* Template Properties */
$tempProperties->setTemplate('default');
/* Header Properties */
$headProperties->setTitle('Testing');
$headProperties->createHeader();
}
}
?>Cheers,
Dom.