voodoo-rocks / yii2-geo
Geo helpers for Yii2.
4.0.0
2017-08-22 23:32 UTC
Requires
- php: >=5.4.0
- 2amigos/yii2-google-maps-library: ^1.0
- yiisoft/yii2: ~2.0
This package is auto-updated.
Last update: 2024-11-27 02:08:14 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