skeeks/yii2-google-api

Component for work with google api based on google/apiclient

Installs: 5 847

Dependents: 1

Suggesters: 0

Stars: 2

Watchers: 1

Forks: 1

Open Issues: 0

Type:yii2-extension

1.0.0 2016-03-28 14:21 UTC

README

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