Question

In my Symfony2 application I sometimes have to use some external APIs, classes, etc. which do not follow the PSR-0 standard.

When I try to use them with the "use" and "new" statements, I get an error that the class was not found. How can I make Symfony load classes which include underscores, for example Some_Class ?

No correct solution

OTHER TIPS

Is class A_B making use of the namespace? If so then you should be able to call it with is FQN EX:

use Acme\CoreBundle\Test\A_B;

Otherwise you need to use a require statement to load the file and that will load the class to the global namespace.

require_once 'Acme/CoreBundle/Test/A_B.php';

Im pretty sure thats how it works. Dont shoot me if im wrong.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top