George Ionita
George Ionita

Reputation: 73

Import a class outside namespace

I'm trying to import a file and instantiate a class that's outside the namespace. The require_once is working, but I'm getting a class not found error when instantiating it. Is there any way around this?

Upvotes: 7

Views: 3916

Answers (1)

Gregory Cosmo Haun
Gregory Cosmo Haun

Reputation: 1576

Simply prefix the class name with a backslash, like so

$waad = new \WAAD_Authentication();

Upvotes: 11

Related Questions