/yii2-google-places-library

Google Places API library for Yii2

Primary LanguagePHPOtherNOASSERTION

Google Places API Library for Yii2

Latest Stable Version Total Downloads Latest Unstable Version License

Extension library to interact with Google Places API

Hey! We are on TutsPlus, check out its tutorial about geolocation and google places

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

Using Search class:

$search = new Search(['key' => '{YOURGOOGLEAPIKEY}']);

// $this->format = 'xml'; // if you wish to handle XML responses (JSON is highly recommended)


// If you setup the format in 'xml', the returned value will be an array.
// The library will decode the response automatically
var_dump($search->text('restaurants in Inca Mallorca'));

Using Place class:

$place = new Place(['key' => '{YOURGOOGLEAPIKEY}']);

// $this->format = 'xml'; // if you wish to handle XML responses (JSON is highly recommended)


$place->details('{REFERENCEIDOFPLACE}'));

Further Information

For further information regarding the multiple parameters of Google Places please visit its API reference

2amigOS!

Web development has never been so fun! www.2amigos.us