PHPackages                             coksnuss/yii2-gii-modelgen - 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. [Framework](/categories/framework)
4. /
5. coksnuss/yii2-gii-modelgen

ActiveYii2-extension[Framework](/categories/framework)

coksnuss/yii2-gii-modelgen
==========================

A tweaked model generator for the Gii module of the Yii 2 framework.

2.0.15-p3(7y ago)42.6k1MITPHP

Since Dec 1Pushed 7y ago2 watchersCompare

[ Source](https://github.com/Coksnuss/yii2-gii-modelgen)[ Packagist](https://packagist.org/packages/coksnuss/yii2-gii-modelgen)[ RSS](/packages/coksnuss-yii2-gii-modelgen/feed)WikiDiscussions master Synced 1mo ago

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

yii2-gii-modelgen
=================

[](#yii2-gii-modelgen)

A tweaked model generator for the Gii module of the Yii 2 framework. The generator re-uses Gii-native code wherever possible and thus has a high chance of retaining all the latest changes of Gii without the need for an update. When checked for the last time, the generator retains the full featureset of Gii 2.0.8.

What this extension does
------------------------

[](#what-this-extension-does)

This extension basically adds three features to gii's basic model template generator:

1. The generated models are splitted into a base model and a concrete model. Whenever the database structure is changed (e.g. through a migration) the base model can simply be overridden by the newly generated model. No custom code is touched. All custom code is written into the concrete model which is used throughout the application and extends the base model.
2. A new option is added to directly integrate the timestamp behavior into models by providing the column names of the created\_at and updated\_at column.
3. When generating models for all tables using the wildcard operator `*` the migration table is omitted.
4. In addition to the model class, it is possible to generate a query class. (*This feature is now natively supported by Gii*)

In addition, the template files were slightly adapted:

1. The `tableName()` function within the generated model classes is only generated if it is required, i.e., if default implementation of `ActiveRecord::tableName()` is insufficient.
2. When generating a query class, it does not contain any boilerplate functions.

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

[](#installation)

First this extension needs to be included via composer by issuing the following console command within the root directory of your yii2 project:

```
composer require --prefer-dist "coksnuss/yii2-gii-modelgen"

```

Furthermore Gii needs to know of the newly available model template. This is achieved by modifying the corresponding configuration file

```
[...]
'class' => 'yii\gii\Module',
'generators' => [
    'model' => ['class' => 'coksnuss\gii\modelgen\generators\model\Generator'],
],
[...]

```

Thats it.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

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 ~124 days

Recently: every ~206 days

Total

13

Last Release

2692d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33861b522beaa32e8ac2a5dd9dca432ca623e6c4cdd5f62166fccc8de208a93f?d=identicon)[Coksnuss](/maintainers/Coksnuss)

---

Top Contributors

[![schnz](https://avatars.githubusercontent.com/u/3457747?v=4)](https://github.com/schnz "schnz (20 commits)")

---

Tags

yii2giimodel template

### Embed Badge

![Health badge](/badges/coksnuss-yii2-gii-modelgen/health.svg)

```
[![Health](https://phpackages.com/badges/coksnuss-yii2-gii-modelgen/health.svg)](https://phpackages.com/packages/coksnuss-yii2-gii-modelgen)
```

###  Alternatives

[yiisoft/yii2-gii

The Gii extension for the Yii framework

21118.4M613](/packages/yiisoft-yii2-gii)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)

PHPackages © 2026

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