Yii 2.0: yii2-google-api

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

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

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

Usage

//App config
[
    'components'    =>
    [
    //....
        'googleApi' =>
        [
            'class'                 => '\skeeks\yii2\googleApi\GoogleApiComponent',
            'developer_key'         => 'YOUR_GOOLE_API_KEY',
        ],
    //....
    ]
]
$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);

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet