spacedealer / yii2-geonames
Yii2 extension for geonames.org webservice api
Installs: 638
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 3
Open Issues: 0
Type:yii2-extension
Requires
- spacedealer/geonames-api: 0.2.*
- yiisoft/yii2: *
Requires (Dev)
- phpunit/phpunit: 4.4.*
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.
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