Skip to content
Geo module with countries and cities
PHP
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
commands
controllers
messages/ru-RU/app/modules
migrations
models
views
.gitignore
CHANGELOG.md
LICENSE
Module.php
README.md
composer.json

README.md

Progress Github all releases GitHub version Progress GitHub license

Yii2 GEO Module

Geo module with countries and cities

Requirements

  • PHP 5.6 or higher
  • Yii2 v.2.0.33 and newest
  • Yii2 Base module (required)

Installation

To install the module, run the following command in the console:

$ composer require "wdmg/yii2-geo"

After configure db connection, run the following command in the console:

$ php yii geo/init

And select the operation you want to perform:

  1. Apply all module migrations
  2. Revert all module migrations
  3. Batch insert demo data*

Migrations

In any case, you can execute the migration and create the initial data, run the following command in the console:

$ php yii migrate --migrationPath=@vendor/wdmg/yii2-geo/migrations

Configure

To add a module to the project, add the following data in your configuration file:

'modules' => [
    ...
    'geo' => [
        'class' => 'wdmg\geo\Module',
        'routePrefix' => 'admin'
    ],
    ...
],

Routing

Use the Module::dashboardNavItems() method of the module to generate a navigation items list for NavBar, like this:

<?php
    echo Nav::widget([
    'options' => ['class' => 'navbar-nav navbar-right'],
        'label' => 'Modules',
        'items' => [
            Yii::$app->getModule('geo')->dashboardNavItems(),
            ...
        ]
    ]);
?>

Status and version [in progress development]

  • v.1.1.8 - Up to date dependencies
  • v.1.1.7 - Fixed deprecated class declaration
  • v.1.1.6 - Added extra options to composer.json (for Butterfly.CMS implementation)
  • v.1.1.5 - Added choice param for non interactive mode
  • v.1.1.4 - Module refactoring
  • v.1.1.3 - Module transferred to base module interface. Update Yii2 version.

* - The demo database contains 144 countries, 111 regions and 4923 cities of such countries as: Russia, Ukraine, Kazakhstan, Azerbaijan, Belarus, Moldova, Poland, South Ossetia, Georgia, Kyrgyzstan, Uzbekistan and contains a total of 20863 translations in EN, UK (Ukrainian), PL, DE. Sources of demo data of countries, cities and regions are initially presented in Russian.

You can’t perform that action at this time.