Q:

routes in zend framework 2 for connecting to google api

I want to connect to a google api and everything works ok if I just run it normally in a .php file, out of my project, but if I want to run the code for connecting to the google api, written in a controller in zend framework 2, with all require_once established well, it shows me the message
    Class 'Auth\Controller\Google_Client' not found in ...\module\Auth\src\Auth\Controller\AuthController.php on line 27.
I mention it's exactly the same code written in the file which is not in the project.
I thought of changing in the Module.php something but I don't know what, maybe it's not that.

A:

Google_Client doesn't look like a namespaced class, but PHP is trying to include it relative to the current namespace Auth\Controller. I think you need to put a \ in front, new \Google_Client()

