How to do you include a class in Symfony2? How to do you include a class in Symfony2? symfony symfony

How to do you include a class in Symfony2?


Use the app/autoload.php file to configure your autoload mechanism.

If your class doesn't follow PEAR style conventions or PSR-0 standards then you should plainly require it (as is the case with Swiftmailer in the same file)

If your class follows PEAR conventions then you should use registerPrefixes method else, if your class follows PSR-0 standard (maybe not the case), you should use the registerNamespaces method