spacedealer/yii2-here

Yii2 extension here.com REST api

Installs: 113

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 4

Forks: 0

Open Issues: 0

Type:yii2-extension

0.1.0 2015-02-04 14:43 UTC

This package is auto-updated.

Last update: 2024-09-29 00:11:39 UTC


README

Attention: Please do not use in production environments. It‘s WIP.

This is a Here APIs client extension for the Yii2 Framework. It wraps around the here-api php library.

Please see here-api php library readme for currently supported APIs.

Build Status SensioLabsInsight Dependency Status

Requirements

  • php >= 5.4
  • spacedealer/here-api 0.1

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist spacedealer/yii2-here "*"

or add

"spacedealer/yii2-here": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply modify your application components configuration as follows:

'here' => [
	'class' => 'spacedealer\here\Here',
	'appCode' => 'your_app_code',
	'appId' => 'your_app_id',
],

Use within your Yii2 application logic:

$geocoder = \Yii::$app->get('here')->getGeoCoder();
$response = $geocoder->geocode([
   'city' => 'Berlin',
   'postalCode' => '10997',
   'street' => 'Schlessische Str.',
   'housenumber' => '28',
]);
$displayPosition = $response->getPath('Response/View/0/Result/0/Location/DisplayPosition');

Resources