PHPackages                             ofilin/yii2-geoip - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ofilin/yii2-geoip

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

ofilin/yii2-geoip
=================

Yii 2 GeoIP extension. Returns country, city, lat, lng of current or specified IP (uses MaxMind's GeoIP2 databases)

1.0.7(2y ago)015MITPHPPHP &gt;=5.4.0

Since Jun 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ofilin/yii2-geoip)[ Packagist](https://packagist.org/packages/ofilin/yii2-geoip)[ RSS](/packages/ofilin-yii2-geoip/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

Yii 2 GeoIP extension
=====================

[](#yii-2-geoip-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/1f46acf32b7466c75cdd60699a65ec6087f6439be1329401cbc9ddd0d4e9ea7a/68747470733a2f2f706f7365722e707567782e6f72672f6f66696c696e2f796969322d67656f69702f76657273696f6e)](https://packagist.org/packages/ofilin/yii2-geoip)[![Total Downloads](https://camo.githubusercontent.com/6dcf4ffaf17672eec767ad7e9dcdf1dc4e9a196a2dc7c99611b144b7b3c9f7d2/68747470733a2f2f706f7365722e707567782e6f72672f6f66696c696e2f796969322d67656f69702f646f776e6c6f616473)](https://packagist.org/packages/ofilin/yii2-geoip)[![Build Status](https://camo.githubusercontent.com/40221ca581c20b22a8c9c6fbb8f1d59a398a919bbba631b94950f42a1b36ab23/68747470733a2f2f7472617669732d63692e6f72672f6f66696c696e2f796969322d67656f69702e7376673f6272616e63683d312e302e31)](https://travis-ci.org/ofilin/yii2-geoip)

Provides information about geographical location of user by IP address.

Currently available:

- Country
- City
- Latitude, Longitude
- Country ISO Code

Install
-------

[](#install)

Run

```
$ php composer.phar require ofilin/yii2-geoip "~1.0"
```

#### OR

[](#or)

add to your `composer.json`

```
{
    "require": {
        "ofilin/yii2-geoip": "~1.0"
    }
}
```

and run

```
$ php composer update
```

Usage
-----

[](#usage)

### Like component

[](#like-component)

```
