yii2-google-places-library Google Places API library for Yii2

  1. Introduction
  2. Installation
  3. Usage
  4. Resources

Introduction

Extension library to interact with Google Places API

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}']);

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

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

For further information, check out the great tutorial about geolocation and google places using this library on TutsPlus

Resources

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

0 0
3 followers
0 downloads
Yii Version: 2.0
License: BSD-2-Clause
Category: Web Service
Developed by: Antonio Ramirez
Created on: Feb 12, 2015
Last updated: 9 years ago

Related Extensions