Welcome Guest, Not a member yet? Register   Sign In
Google client library integration in codeigniter 4
#1
Shocked 

Hi. I have installed google api client via composer and it runs good using composer. But whenever i tried to run it in browser i am facing error(attached). Composer after vendor/autoload.php load client library but browser integration needs something else. any help? thanks in advance

Attached Files Thumbnail(s)
   
Reply
#2

Stop the Earth, I'll get off(с)

CI4 includes the Composer autoloader by default. 
This line is not needed.
require ROOTPATH . 'vendor/autoload.php'; 


The controller have App\Controller namespace.
When you create instance of the Google_client() , it is called in the App\Controller context.
But in this context, the Google_client class does not exist.

Read the library documentation how to create class instance. 

Read the php documentation about namespace.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB