Coder Social home page Coder Social logo

yii2-google-places-library's Introduction

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


Custom Software Development | Web & Mobile Development Software
www.2amigos.us

yii2-google-places-library's People

Contributors

borales avatar kurpievski avatar lrod avatar tonydspaniard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-google-places-library's Issues

More Examples

After Configuration Is there more examples that how to use in view (_form) and controller ...

In have this error

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for 2amigos/yii2-google-places-library * -> satisfiable by 2amigos/yii2-google-places-library[0.1.0].
- Conclusion: remove guzzlehttp/guzzle 6.2.2
- Conclusion: don't install guzzlehttp/guzzle 6.2.2
- 2amigos/yii2-google-places-library 0.1.0 requires guzzlehttp/guzzle 4.* -> satisfiable by guzzlehttp/guzzle[4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.1.6, 4.1.7, 4.1.8, 4.2.0, 4.2.1, 4.2.2, 4.2.3, 4.2.4].
- Can only install one of: guzzlehttp/guzzle[4.0.0, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.0.1, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.0.2, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.0, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.1, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.2, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.3, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.4, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.5, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.6, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.7, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.1.8, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.2.0, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.2.1, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.2.2, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.2.3, 6.2.2].
- Can only install one of: guzzlehttp/guzzle[4.2.4, 6.2.2].
- Installation request for guzzlehttp/guzzle (locked at 6.2.2) -> satisfiable by guzzlehttp/guzzle[6.2.2].

Installation failed, reverting ./composer.json to its original content.

Guzzle version

Hi!
Is there a reason for limiting Guzzle version up to "4.*"?

"guzzlehttp/guzzle": "4.*"

The current version of Guzzle is 5.2

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.