yii2-google-places-library

Google Places API library for Yii2

Github星跟蹤圖

Google Places API Library for Yii2

Packagist Version
Latest Stable Version
Total Downloads
Latest Unstable Version
Scrutinizer Code Quality

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

主要指標

概覽
名稱與所有者2amigos/yii2-google-places-library
主編程語言PHP
編程語言PHP (語言數: 1)
平台
許可證Other
所有者活动
創建於2014-05-28 06:46:00
推送於2019-04-09 10:26:32
最后一次提交2019-01-23 15:13:46
發布數5
最新版本名稱1.0.3 (發布於 )
第一版名稱0.1.0 (發布於 2014-09-01 15:52:47)
用户参与
星數23
關注者數17
派生數17
提交數23
已啟用問題?
問題數5
打開的問題數0
拉請求數4
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?