2amigos/yii2-google-places-library

此包已被废弃,不再维护。未建议替换包。

Yii2 的 Google 地点 API 库。

安装次数: 66,896

依赖: 2

建议者: 0

安全: 0

星标: 23

关注者: 18

分支: 16

开放问题: 0

类型:yii2-extension

1.0.3 2019-01-23 14:13 UTC

This package is auto-updated.

Last update: 2023-08-09 19:50:26 UTC


README

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

扩展库,用于通过封装我们2amigos/google-places-library的方法与Google 地点 API进行交互,将其封装成 Yii2 组件。

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

php composer.phar require "2amigos/yii2-google-places-library" "*"

或者将以下内容添加到应用程序的 composer.json 文件中的 require 部分:

"2amigos/yii2-google-places-library" : "*"

That's it, you are ready to use them as Yii2 components.

安装

首选方式是将组件设置到我们应用程序的配置数组中

'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.

使用搜索组件

// 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'));

使用地点组件

var_dump(Yii::$app->place->details('{REFERENCEIDOFPLACE}'));

更多信息

有关 Google 地点的多个参数的更多信息,请访问其 API 参考以及我们的独立库2amigos/google-places-library

687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67
定制软件开发 | 网络和移动开发软件
www.2amigos.us