Code: Select all
<?php
/**
* Description of template
*
* @author Dominic Sore
*/
class template {
public function __construct() {
$this->defineTemp(Header);
}
public function defineTemp($funcId){
$funcDefSetUp = strtoupper($funcId);
$defSelf = 'TEMPL_';
$funcDef = $defSelf.$funcDefSetUp;
$funcCallSetUp = ucfirst($funcId);
$callSelf = 'self::templ';
$callBrak = '()';
$funcCall = $callSelf.$funcCallSetUp.$callBrak;
define($funcDef, $funcCall);
}
public function templHeader(){
echo 'Head Here';
}
}
?>Code: Select all
define(TEMPL_HEADER, self::templHeader());Cheers,
Dom