I have a class that I want symfony2 to autoload so I can reference it from inside one of my registered services (I do not want to use the service container for this class). I dropped it into src/{Vendor}/{BundleName}/Services but I’m getting a class not found exception.
Do I have to explicitly request that that directory gets autoloaded in autoload.php?
There’s got to be a better way.
I don’t understand why you won’t put this class in your bundle?
If you want your class to be bundle independant, then put it in it’s own bundle library:
You can now use
The src directory is the fallback in the autoloader, so you wont need to explicitly declare its namespace there, however you will need to comply with PSR-0