spacedealer/yii2-geonames

Yii2 extension for geonames.org webservice api

0.2.0 2015-02-04 14:48 UTC

This package is auto-updated.

Last update: 2024-11-29 00:34:59 UTC


README

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

This is a Geonames API client extension for the Yii2 Framework. It wraps around the geonames-api php library.

Build Status SensioLabsInsight Dependency Status

Requirements

  • php >= 5.4
  • spacedealer/geonames-api 0.2

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

"spacedealer/yii2-geonames": "*"

to the require section of your composer.json file.

Usage

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

'geonames' => [
	'class' => 'spacedealer\geonames\Geonames',
	'username' => 'your_username',
	'language' => 'de',
],

Use within your Yii2 application logic:

$geonames = \Yii::$app->get('geonames')->getClient();
$response = $geonames->postalCodeSearch([
	'country' => 'de',
	'postalcode' => '10997',
]);

Todos

  • add unit tests

Resources