Quick Tip: PSR-0 Namespaces in Sugar 7

If you want to use namespaces following the PSR-0 standard for your custom code, it is now possible with the SugarAutoLoader in sugar7. Now you don’t have to insert require statements all over the place.


SugarAutoLoader::addNamespace('Fbsg\\', 'custom/include/Fbsg');

Sugar’s autoloader will now map requests for the class Fbsg\Example\Test to the file “custom/include/Fbsg/Example/Test.php”.