Namespace Problem
Posted: Sat Oct 31, 2009 12:06 am
I'm having problem with a section of code with a variable namespace.
This code works fine:
However this code does not:
My "autoloader" (PHP handles namespace autoloading automatically):
I've trawled through the manual with no luck.. 
Any ideas?
This code works fine:
Code: Select all
$c = new \Apps\Admin\Views\Index;
Code: Select all
echo $val[1];
// Outputs \Apps\Admin\Views\Index;
$c = new $val[1]
//( ! ) Fatal error: spl_autoload() [function.spl-autoload]: Class \Apps\Admin\Views\Index could not be loaded in C:\wamp\www\_dev\Rain\Urls\Router.php on line 69
Code: Select all
spl_autoload_extensions(".php");
spl_autoload_register();
Any ideas?