PHPackages                             zacksleo/yii2-lookup - 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. zacksleo/yii2-lookup

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

zacksleo/yii2-lookup
====================

Yii2 lookup module

1.2.1(8y ago)411.2k2BSD-3-ClausePHPCI failing

Since Nov 30Pushed 8y ago2 watchersCompare

[ Source](https://github.com/zacksleo/yii2-lookup)[ Packagist](https://packagist.org/packages/zacksleo/yii2-lookup)[ RSS](/packages/zacksleo-yii2-lookup/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

Lookup Module For Yii2
======================

[](#lookup-module-for-yii2)

[![Latest Stable Version](https://camo.githubusercontent.com/afa7f9a4528c7a0b29861e1ac5861978b40684017895bf4f2ef54901eda06905/68747470733a2f2f706f7365722e707567782e6f72672f7a61636b736c656f2f796969322d6c6f6f6b75702f76657273696f6e)](https://packagist.org/packages/zacksleo/yii2-lookup)[![Total Downloads](https://camo.githubusercontent.com/4b1ac4e9f850a4f36d45c4c71cd2f36f49b1b302ae841552e76e184ebc8f2715/68747470733a2f2f706f7365722e707567782e6f72672f7a61636b736c656f2f796969322d6c6f6f6b75702f646f776e6c6f616473)](https://packagist.org/packages/zacksleo/yii2-lookup)[![Build Status](https://camo.githubusercontent.com/7983be4c075a928c395a6d2c45137089ca30c9418e2b79d8e1860a1b70e406dc/68747470733a2f2f7472617669732d63692e6f72672f7a61636b736c656f2f796969322d6c6f6f6b75702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zacksleo/yii2-lookup)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3684dfdf2ae0d95b0a1e652cef2def05e2e3782256343432c93a4cc8db04f471/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a61636b736c656f2f796969322d6c6f6f6b75702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zacksleo/yii2-lookup/?branch=master)![Code Climate](https://camo.githubusercontent.com/acd989a474440c2dbcdfd570cd0d062ddbf3638dd5a96d6241762ab1c68043f8/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f7a61636b736c656f2f796969322d6c6f6f6b75702e737667)[![Code Coverage](https://camo.githubusercontent.com/b572cebe733344e8d356a26b9c36a4a6cf97c083df9f1fe322809350d2932f8c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a61636b736c656f2f796969322d6c6f6f6b75702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zacksleo/yii2-lookup/?branch=master)[![StyleCI](https://camo.githubusercontent.com/b606d7a8a60dbb492214c6abbd825a6cfa644d1c277749b3c677ba9a1040ecc3/68747470733a2f2f7374796c6563692e696f2f7265706f732f37353137323735332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/75172753)

Migrate database
----------------

[](#migrate-database)

To add a lookup table to your database, following is the sql for lookup:

```

CREATE TABLE IF NOT EXISTS `lookup` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(100) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `code` int(11) DEFAULT '1',
  `comment` text,
  `active` tinyint(1) DEFAULT '1',
  `order` int(11) DEFAULT '1',
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `CK_Type_Name_Unique` (`type`,`name`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

```

Or else you can use yii migration

```

yii migrate/up --migrationPath=@zacksleo/yii2/lookup/migrations

```

Config the components
---------------------

[](#config-the-components)

To access the lookup functionality anywhere in you application (either frontend or backend) follow the following steps:

```
In your main.php under config folder add the following:
    'components' => [
        ---
        'lookup' => [
            'class' => 'zacksleo\yii2\lookup\models\Lookup',
        ],
        ---
    ]

```

Customize the form
------------------

[](#customize-the-form)

Following are the few usage of lookup functionality:

```

/*** dropdown list from lookup ***/

/*** RadioButton List ***/

/*** CheckBoxes List ***/

/*** Dropdown List from Lookup ***/

```

Inspired By [Ibrar Turi](http://blog.ituri.net/2015/10/yii2-lookup-module/) @ibrarturi, Thanks for his work.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 53.2% 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 ~87 days

Total

5

Last Release

3100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e97b8a6f67b09513e345a128d73a63898ae1ec9f6a6c77234c78b3f16d305d1?d=identicon)[zacksleo](/maintainers/zacksleo)

---

Top Contributors

[![monster-hunter](https://avatars.githubusercontent.com/u/7071275?v=4)](https://github.com/monster-hunter "monster-hunter (92 commits)")[![zacksleo](https://avatars.githubusercontent.com/u/3369169?v=4)](https://github.com/zacksleo "zacksleo (41 commits)")[![withubmoa](https://avatars.githubusercontent.com/u/4962678?v=4)](https://github.com/withubmoa "withubmoa (40 commits)")

---

Tags

lookupyii2yii2-extensionyii2modulelookup

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zacksleo-yii2-lookup/health.svg)

```
[![Health](https://phpackages.com/badges/zacksleo-yii2-lookup/health.svg)](https://phpackages.com/packages/zacksleo-yii2-lookup)
```

###  Alternatives

[branchonline/yii2-lightbox

Lightbox widget for Yii2

13139.0k1](/packages/branchonline-yii2-lightbox)[akiraz2/yii2-ticket-support

Yii2 Support Ticket Module, easy, flexible, fast

611.7k](/packages/akiraz2-yii2-ticket-support)

PHPackages © 2026

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