skeeks/yii2-google-api Component for work with google api based on google/apiclient

Component for work with official google api

  1. Installation
  2. How to use

Partly wrapper over powerful official package from google — google/apiclient

Latest Stable Version Total Downloads

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist skeeks/yii2-google-api "*"

or add

"skeeks/yii2-google-api": "*"

How to use

Configuration app
//App config
[
    'components'    =>
    [
    //....
        'googleApi' =>
        [
            'class'                 => '\skeeks\yii2\googleApi\GoogleApiComponent',
            'developer_key'         => 'YOUR_GOOLE_API_KEY',
        ],
    //....
    ]
]

An example of the Api transliteration

https://cloud.google.com/translate/v2/using_rest


$service = new Google_Service_Translate(\Yii::$app->googleApi->client);
$result = $service->languages->listLanguages([
    'target' => 'ru'
]);
print_r($result);


$result = $service->translations->listTranslations('apple', 'ru');
print_r($result);

skeeks!
SkeekS CMS (Yii2) — quickly, easily and effectively!
skeeks.com | cms.skeeks.com

1 0
1 follower
5 992 downloads
Yii Version: 2.0
License: GPL-3.0+
Category: Web Service
Developed by: skeeks
Created on: Jan 24, 2019
Last updated: (not set)
Packagist Profile
Github Repository

Related Extensions