问题
I followed the instruction on slim framework. Created a composer.json file in my directory
{
"require": {
"slim/slim": "2.*"
}
}
and run composer install file. I have the following directory structure now

As described in the documentation at slim framework i created an index.php file and require the vendor/autoload.php
But i am getting Class not found error.
Thanks
回答1:
Try using namespaces when instantiating classes ... like so new \Slim\Slim();
.
来源:https://stackoverflow.com/questions/28126614/class-slim-not-found-when-installing-slim-with-composer