okay i know the Autoloader class works and it finds the file but this is what i wanna do
How can i link the variable to the class?
Here is the error i get..
So i am guessing this is illegal
does anyone know how i can link the controller\$this->controller to $this->controller
EDIT : I figured it out....
Sorry please close thread!
PHP:
$this->controller = 'Main'
PHP:
<?php
if(class_exists("Controller\$this->controller", true))
{
$this->controller = new Controller\{$this->controller}();
}
?>
How can i link the variable to the class?
Here is the error i get..
Code:
Parse error: syntax error, unexpected '{', expecting identifier (T_STRING)
So i am guessing this is illegal
PHP:
$this->controller = new Controller\$this->controller();
EDIT : I figured it out....
PHP:
$controller = "{Controller\\$this->controller()}";
if(class_exists($controller, true))
{
$this->controller = new $controller;
}
Last edited: