Reputation: 2966
echo Html::a( Yii::t( 'app', ' {modelClass}', [
'modelClass' => $loc_name,
] ), [ 'site/city' ], [ 'class' => 'btn btn-link fa fa-map-marker btn-primary city' ]
);
given above is a code for a dropdown to select a city. is there any way to get it automatically by sensing the location of the user in yii2?
Upvotes: 0
Views: 712
Reputation:
You can use geoip. There's a module for Yii2: https://github.com/rmrevin/yii2-geoip
Upvotes: 4