2amigos/yii2-google-places-library
最新稳定版本:1.0.3
Composer 安装命令:
composer require 2amigos/yii2-google-places-library
包简介
Google Places API Library for Yii2.
README 文档
README
Extension library to interact with Google Places API by wrapping the methods of our 2amigos/google-places-library into Yii2 components.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require "2amigos/yii2-google-places-library" "*"
or add
"2amigos/yii2-google-places-library" : "*"
to the require section of your application's composer.json file.
Usage
The preferred way is to setup the components into our Application's configuration array:
'components' => [ 'places' => [ 'class' => '\dosamigos\google\places\Places', 'key' => '{your-google-api-key-with-places-activated}', 'format' => 'json', // or 'xml' 'forceJsonArrayResponse' => true // for decoding responses to arrays instead of objects ], 'placesSearch' => [ 'class' => '\dosamigos\google\places\Search', 'key' => '{your-google-api-key-with-places-activated}', 'format' => 'json' // or 'xml' ] ]
That's it, you are ready to use them as Yii2 components.
Using Search Component
// If you setup the format in 'json', the returned value will be an array. If 'xml', it will return a SimpleXmlElement. var_dump(Yii::$app->search->text('restaurants in Inca Mallorca'));
Using Places component
var_dump(Yii::$app->place->details('{REFERENCEIDOFPLACE}'));
Further Information
For further information regarding the multiple parameters of Google Places please visit its API reference and our standalone library 2amigos/google-places-library
Custom Software Development | Web & Mobile Development Software
www.2amigos.us
统计信息
- 总下载量: 86.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-05-28