voodoo-rocks/yii2-geo

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Geo helpers for Yii2.

Installs: 531

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-module

4.0.0 2017-08-22 23:32 UTC

This package is auto-updated.

Last update: 2021-08-26 18:46:56 UTC


README

GeoLocation widget

Configs:

    'modules'      => [
        'geo' => [
            'class' => 'vm\geo\module\Module'
        ]
    ],

View file:

    echo GeoLocationWidget::widget()

Getting coordinates (in model or controller):

  $lat = Yii::$app->session->get('coordinates.lat');
  $lng = Yii::$app->session->get('coordinates.lng');

Also you can check geolocation status

  Yii::$app->session->get('coordinates.isLocated');

Will return 1 if already located