How do I install and use YiiGeo?
- Keywords:
- use howto install
- Last updated by:
- Brian Armstrong
INSTALLATION
Extract the contents of the archive to 'protected/
USAGE
Register for an API Key with a support GeoCoder provider
Google registration: http://
Yahoo registration: http://
There are two ways to use the Yii GeoCoder Extension. The first is as an imported standalone object, the second is as an application component.
*Standalone*
<?php
Yii::import(
$geocode = new GeoCoder;
$geocode->init();
$geocode-
$geocode-
$result = $geocode-
*Application Component*
STEP 1: Update your application config
'components' => array(
...
'geocoder' => array(
'class' => 'application.
'api_key' => '<your API key>',
'api_driver' => '<your driver>', // 'google' or 'yahoo'
),
...
)
STEP 2: Using the component
<?php
$result = Yii::app(