JoshuaLuke
Posting Freak
- Jan 29, 2012
- 529
- 51
Hey,
So i'm making a template system using $_GET['p'], here's it so far:
How would I put $this->set('key', 'value'); in the constructor function so it corresponds into any template? I tried a few things but couldn't get it to work. I've never worked with $_GET template systems before so help is good.
So i'm making a template system using $_GET['p'], here's it so far:
PHP:
<?php
## Deny any access
if(!defined('ALLOWED')){exit();}
## Begin the class
class template {
public function initiate() {
global $CONF;
if(!isset($_GET['p'])) {
header('Location: index.php?p=index');
} else {
include('templates/' . $CONF['site']['template'] . '/' . $_GET['p'] . '.php');
}
}
}
?>