Commit 108b193c8204a3ea614c53da0c460c135d232bb8

Authored by Alex Savenko
1 parent a3fa7958

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

Showing 2 changed files with 11 additions and 0 deletions   Show diff stats
backend/config/main.php
... ... @@ -167,6 +167,10 @@ return [
167 167 'seo-dynamic/<action>/<seo_category_id:[A-Za-z0-9_-]+>/<id:[A-Za-z0-9_-]+>' => 'seo-dynamic/<action>',
168 168 'seo-dynamic/<action>/<seo_category_id:[A-Za-z0-9_-]+>' => 'seo-dynamic/<action>',
169 169 ]
  170 + ],
  171 + 'googleApi' => [
  172 + 'class' => '\skeeks\yii2\googleApi\GoogleApiComponent',
  173 + 'developer_key' => 'AIzaSyAYpoZOIyddp23AILP7GzyFBzTx1P_kHgQ',
170 174 ]
171 175  
172 176 ],
... ...
backend/views/report/index.php
... ... @@ -18,4 +18,11 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
18 18  
19 19 <div>
20 20 <h1><?= Html::encode($this->title) ?></h1>
  21 + <?php
  22 + $service = new Google_Service_Translate(\Yii::$app->googleApi->client);
  23 + $result = $service->languages->listLanguages([
  24 + 'target' => 'ru'
  25 + ]);
  26 + print_r($result);
  27 + ?>
21 28 </div>
22 29 \ No newline at end of file
... ...