PHPackages                             uranum/yii2-define-location - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. uranum/yii2-define-location

ActiveLibrary

uranum/yii2-define-location
===========================

Define the user location by ip or set it manually. For Yii2 app.

1.0.3.1(7y ago)122MITPHPPHP ^7.0.0

Since Oct 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/uranum/yii2-define-location)[ Packagist](https://packagist.org/packages/uranum/yii2-define-location)[ RSS](/packages/uranum-yii2-define-location/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (11)Used By (0)

yii2-define-location
====================

[](#yii2-define-location)

Define the user location by ip or set it manually

### Installation

[](#installation)

```
composer require uranum/yii2-define-location:"dev-master"
```

### Setup

[](#setup)

Подключить модуль в common/config.php (он должен быть доступен для консольных команд!)

```
'modules' => [
    'location' => [
        'class' => 'uranum\location\Module',
        'userModelClass' => 'frontend\modules\user\models\User', // здесь указать класс модели User,
        'vkSecretToken' => 'your_secret_vk_token', // получить в настройках своего приложения в vk.com  https://vk.com/editapp?id=[your_id]&section=options
    ],
]
```

Для автоматического определения местоположения настройте компонент [Yii2 IpGeoBase.ru wrapper](https://github.com/himiklab/yii2-ipgeobase-component)(инструкции по [ссылке](https://github.com/himiklab/yii2-ipgeobase-component#%D0%A3%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0), установка компонента не требуется, только указание компонента в конфигурации).

Указать в конфигурации, в секции bootstrap следующие строки:

```
bootstrap' => [
    ....,
    'location',
    'uranum\location\InitApp'
],
```

Применить миграцию:

```
php yii migrate --migrationPath=@uranum/location/migrations
```

Вывести виджет в нужном месте:

```
echo  \uranum\location\widget\Location::widget([
    // здесь можно настроить публичные свойства виджета, задав свои значения (загляните в исходный код)
]);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~72 days

Total

10

Last Release

2641d ago

PHP version history (2 changes)1.0.1PHP &gt;=7.0.0

1.0.2.3PHP ^7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c9f9f235c2de107043176b29e425b2cb770ba2bca3a14e80d452b8a7474ac1d?d=identicon)[Eugeny\_Emelyanov](/maintainers/Eugeny_Emelyanov)

---

Top Contributors

[![uranum](https://avatars.githubusercontent.com/u/19322573?v=4)](https://github.com/uranum "uranum (22 commits)")

---

Tags

IPyii2locationyii 2

### Embed Badge

![Health badge](/badges/uranum-yii2-define-location/health.svg)

```
[![Health](https://phpackages.com/badges/uranum-yii2-define-location/health.svg)](https://phpackages.com/packages/uranum-yii2-define-location)
```

###  Alternatives

[kartik-v/yii2-ipinfo

An IP address information display widget for Yii 2.0 with country flag and geo position info.

2832.6k1](/packages/kartik-v-yii2-ipinfo)[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20144.4k11](/packages/softark-yii2-dual-listbox)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
