Hey Guys....again!
I just threw this together, I know its nothing like a proper page controller but it works for me. CAn anyone see any issues with this code?
Thanks
PHP Code:
class pageController {
var $page;
var $plugin;
var $dir;
var $file;
function pageController() {
$this->page = $_GET['page'].'.php';
$this->plugin = $_GET['page'];
$this->dir = 'lib/plugins/';
$this->file = $this->dir . $this->page;
}
function pageExists() {
if(file_exists("$this->file")) {
$this->pageRedirect();
} else {
$this->errorRedirect();
}
}
function pageRedirect() {
switch ($this->plugin) {
case "$this->plugin":
include("$this->dir"."$this->page");
break;
}
}
function errorRedirect() {
include("$this->dir"."error.php");
}
}





Bookmarks