PHPackages                             kartik-v/yii2-ipinfo - 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. kartik-v/yii2-ipinfo

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

kartik-v/yii2-ipinfo
====================

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

v2.0.2(6y ago)2832.6k↓50%111BSD-3-ClausePHP

Since Jul 18Pushed 6y ago3 watchersCompare

[ Source](https://github.com/kartik-v/yii2-ipinfo)[ Packagist](https://packagist.org/packages/kartik-v/yii2-ipinfo)[ Docs](https://github.com/kartik-v/yii2-ipinfo)[ RSS](/packages/kartik-v-yii2-ipinfo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (1)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-ipinfo ---

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-ipinfo--------------------)

[![Stable Version](https://camo.githubusercontent.com/2eba3d7b11d532af2e75dc4eb4efea37e639462990b83fe16485f828ffc07776/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6970696e666f2f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-ipinfo)[![Unstable Version](https://camo.githubusercontent.com/7280ad02f4e8a46033f3a667b8ef1546ad26f8c4e6b3504aaf22e140b258dff1/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6970696e666f2f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-ipinfo)[![License](https://camo.githubusercontent.com/1874ae2d39e1c81b25156d673aca870729d81a7f85bc4857167e3b229d475f49/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6970696e666f2f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-ipinfo)[![Total Downloads](https://camo.githubusercontent.com/98abc435305ab2c5d3415d5e8c2b29c8907461268b254c3d2088ab547dbc8ba4/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6970696e666f2f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-ipinfo)[![Monthly Downloads](https://camo.githubusercontent.com/bb05a9276c10676c6aa94ac6854248236e0855bafe00c727c475b9a36b50b44f/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6970696e666f2f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-ipinfo)[![Daily Downloads](https://camo.githubusercontent.com/8c403cbe8d0c0a59149e76c87ca84217cf766267153f59bb996a49b019e3f2f9/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6970696e666f2f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-ipinfo)

An IP address information display widget for Yii framework 2.0 with ability to display country flag and geo position info. This is based on the [HTTP API from ip-api.com](http://ip-api.com) to parse IP address details. The plugin also uses the [yii2-popover-x](http://demos.krajee.com/popover-x) extension by Krajee and the [yii2-httpclient](https://github.com/yiisoft/yii2-httpclient) yiisoft extension for fetching and displaying IP details via a popover, and the [yii2-icons](http://demos.krajee.com/icons) extension by Krajee for displaying the flag icons.

Features
--------

[](#features)

- Ability to display the flag for a IP address.
- Implement **Yii2 HTTP Client** to process IP API info fetch. The 1.0 AJAX based API query will be eliminated and replaced with the Yii2 server based HTTP Client. This will ensure it works both for HTTPS and HTTP and also use yii2 caching.
- Implement **Yii2 Cache** component to cache/store IP data. If Cache component is not defined no caching will be performed.
- Implement **Yii2 DetailView** widget to render the IP Information Details table. The layout of attributes and formats can therefore be customized as per user need.
- Ability to display geo position details for the IP address.
- Ability to use your own API if needed
- Ability to render IP details inline instead of popover.
- Ability to configure fields rendered and also control the layout with templates.
- Use `yii2-popover-x` extension features to control popover placements and styles.
- Use flag icons from `yii2-icons` to render country wise high resolution flags of any size.
- Uses Yii i18N translations to generate locale specific data.

> Note: Check the [composer.json](https://github.com/kartik-v/yii2-ipinfo/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

Demo
----

[](#demo)

You can see detailed [documentation and examples](http://demos.krajee.com/ipinfo) on usage of the extension.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

> Note: Check the [composer.json](https://github.com/kartik-v/yii2-ipinfo/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

Either run

```
$ php composer.phar require kartik-v/yii2-ipinfo "@dev"

```

or add

```
"kartik-v/yii2-ipinfo": "@dev"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

### IpInfo

[](#ipinfo)

```
use kartik\ipinfo\IpInfo;

echo IpInfo::widget([
    'ip' => '12.23.155.123',
    /**
     * optionally setup more options
     * refer docs for all options
     */
    // 'showFlag' => true,
    // 'showPopover' => true,
    // 'popoverOptions' => [],
    // 'flagWrapperOptions' => []
    // 'flagOptions' => []
]);
```

License
-------

[](#license)

**yii2-ipinfo** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 75.6% 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 ~89 days

Recently: every ~109 days

Total

6

Last Release

2409d ago

Major Versions

v1.0.2 → v2.0.02019-10-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (31 commits)")[![werewolf8904](https://avatars.githubusercontent.com/u/23662660?v=4)](https://github.com/werewolf8904 "werewolf8904 (4 commits)")[![Edofre](https://avatars.githubusercontent.com/u/710429?v=4)](https://github.com/Edofre "Edofre (2 commits)")[![gugoan](https://avatars.githubusercontent.com/u/1585443?v=4)](https://github.com/gugoan "gugoan (2 commits)")[![ricardomm85](https://avatars.githubusercontent.com/u/11030924?v=4)](https://github.com/ricardomm85 "ricardomm85 (2 commits)")

---

Tags

IPyii2extensionmodulelocationflaggeocountryipinfoposition

### Embed Badge

![Health badge](/badges/kartik-v-yii2-ipinfo/health.svg)

```
[![Health](https://phpackages.com/badges/kartik-v-yii2-ipinfo/health.svg)](https://phpackages.com/packages/kartik-v-yii2-ipinfo)
```

PHPackages © 2026

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