Nova Poshta Api
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist aksi0/yii2-novaposhta "dev-master"
or add
"aksi0/yii2-novaposhta": "dev-master"
to the require section of your composer.json
file.
- Setup configuration:
'components' => [
'novaPoshta' => [
'class' => 'aksi0\novaposhta\NovaPoshta',
'api_key' => '*specify your api key*'
]
]
- Getting/Search cities
$novaPoshta = Yii::$app->novaPoshta;
// get all cities
$cities = $novaPoshta->getAddress()->getCities();
// or search
$cities = $novaPoshta->getAddress()->getCities('Dnipro');