Quote
[error] [client 127.0.0.1] PHP Fatal error: Using $this when not in object context in C:\\wamp\\www\\system\\engines\\system.php on line 133
This is line 133 of system.php:
$this->redirect($this->config['site']['base_url'], 301, true);
Here is the entire function
public function loadModule($module)
{
if(!is_string($module))
{
trigger_error("system::loadModule: This function only supports single loads at a time", FATAL);
}
if(include_once("system/modules/{$module}.php"))
{
return new $module;
} else {
trigger_error("system::loadModule: Unable to find the module '{$module}' within the modules folder... Redirecting to 'base url'", WARNING);
$this->redirect($this->config['site']['base_url'], 301, true);
}
}
This is the code that calls the function (this is index.php)
if($_SERVER['REQUEST_URI'] == '/' || $_SERVER['REQUEST_URI'] == '/index.php')
{
$control[1] = $config['site']['default'];
} else {
$control = explode("/", $_SERVER['REQUEST_URI']);
}
$controller = $system::loadModule($control[1]);
Now after googling the error message all i can really find is stuff to do with code migration from php 4 to php 5. Currently i am running php 5.3.0 so any help would be very appreciated

New Topic/Question
Reply



MultiQuote




|