DomingoSL
DomingoSL

Reputation: 15504

Include a php class -the old way- on Symfony 2

I need a fast way to test a code, please I know is not the best practice, but is there a way to load a class on a symfony controller without having to add namespaces, proxy class and autoloader stuff?

I tried:

public function singlepagestatsAction($id, $pid, $group) { 
    include '/var/www/web/welcomestuff/scripts/ga/gapi.class.php';
            $ga = new gapi('email','password');

Inside my controller, but when i execute it; Fatal error: Class 'Done\PunctisBundle\Controller\gapi' not found in /var/www/src/Done/PunctisBundle/Controller/BrandController.php on line 630

Upvotes: 0

Views: 219

Answers (1)

jamek
jamek

Reputation: 812

You should add \ before class name

$ga = new \gapi('email','password');

Upvotes: 3

Related Questions