Simple extension for getting list of user's spreadsheets and open selected spreadsheet in IFRAME.
Example of using Google REST API and OAuth2 authorization.
Follow the instructions - Setting up OAuth 2.0 .
$ composer require sergmoro1/yii2-google-spreadsheet "dev-master"
1.Copy model, controller and views from ./example to corresponding directories of your app. Change methords and actions or leave them as is.
2.Define constants in params file (for ex. in frontend/config/params.php).
<?php return [ 'clientId' => '***', 'clientSecret' => '***', // dev (for ex.) 'redirectUri' => 'http://localhost/yoursite/frontend/web/google/oauth', // production //'redirectUri' => 'http://yoursite/google/oauth', ];
3.Declare Redirect Uri in your Google Project. For ex.
// dev
http://localhost/yousite/frontend/web/google/oauth2
// production
http://yoursiteDOTcom/google/oauth2
http://yoursite_or_localhost_path/google