This package is abandoned and no longer maintained. No replacement package was suggested.

Google Places API Library for Yii2.

Installs: 65 518

Dependents: 2

Suggesters: 0

Security: 0

Stars: 23

Watchers: 18

Forks: 16

Open Issues: 0


1.0.3 2019-01-23 14:13 UTC

This package is auto-updated.

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


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.


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.


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


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