PHPackages                             jsyqw/layui-gii - 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. jsyqw/layui-gii

ActiveYii2-extension

jsyqw/layui-gii
===============

基于Yii2框架，通过gii生成layui布局,生成统一的API格式

v0.1.3(5y ago)015[1 issues](https://github.com/jasonyqwang/layui-gii/issues)PHP

Since Apr 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jasonyqwang/layui-gii)[ Packagist](https://packagist.org/packages/jsyqw/layui-gii)[ RSS](/packages/jsyqw-layui-gii/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (4)Used By (0)

开发 Yiii2 的扩展包
=============

[](#开发-yiii2-的扩展包)

一.使用composer安装
==============

[](#一使用composer安装)

1.安装
----

[](#1安装)

```
    composer require jsyqw/layui-gii

```

2.使用
----

[](#2使用)

在 Yii 的配置文件中，添加如下配置

```
    ...
    $config['modules']['gii'] = [
            'class' => 'yii\gii\Module',
            // uncomment the following to add your IP if you are not connecting from localhost.
            //'allowedIPs' => ['127.0.0.1', '::1'],
            'generators' => [
                'crud' => [ //生成器名称
                    'class' => 'Jsyqw\Layuigii\crud\Generator',
                    'templates' => [ //设置我们自己的模板
                        //模板名 => 模板路径
                        'layuiCrud' => '@vendor/layui-gii/src/crud/default',
                    ]
                ],
                'model' => [ //生成器名称
                    'class' => 'Jsyqw\Layuigii\model\Generator',
                    'templates' => [ //设置我们自己的模板
                        //模板名 => 模板路径
                        'layuiModel' => '@vendor/layui-gii/src/model/default',
                    ]
                ]
            ],
        ];
    ...
```

二.基于git引用该项目
============

[](#二基于git引用该项目)

1.初始化 composer 配置
-----------------

[](#1初始化-composer-配置)

```
{
    "name": "jsyqw/layui-gii",
    "description": "基于Yii2框架的扩展，通过gii生成layui布局",
    "type": "yii2-extension",
    "authors": [
        {
            "name": "Jason Wang",
            "email": "1045643440@qq.com"
        }
    ],
    "require": {},
    "autoload": {
        "psr-4": {
            "Jsyqw\\Layuigii\\": "src/"
        }
    }
}

```

2.配置最外层的composer.json
---------------------

[](#2配置最外层的composerjson)

```
    {
       "autoload": {
              "psr-4": {
                  "Jsyqw\\Layuigii\\": "vendor/layui-gii/src/"
              }
       }
    }
```

3.运行：composer dumpautoload
--------------------------

[](#3运行composer-dumpautoload)

```
> composer dumpautoload
> Generated autoload files containing 543 classes
```

对应的 autoload\_psr4.php 会多一条信息 'Jsyqw\\Layuigii\\' =&gt; array($vendorDir . '/layui-gii/src'),

eg：

```
    ...
    'Jsyqw\\Utils\\' => array($vendorDir . '/jsyqw/utils/src'),
    'Jsyqw\\Ret\\' => array($vendorDir . '/jsyqw/results/src'),
    'Jsyqw\\Layuigii\\' => array($baseDir . '/layui-gii/src'),
    'JmesPath\\' => array($vendorDir . '/mtdowling/jmespath.php/src'),
    'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
    ...
```

项目配置
----

[](#项目配置)

在 Yii 的配置文件中，添加如下配置

```
    ...
    $config['modules']['gii'] = [
            'class' => 'yii\gii\Module',
            // uncomment the following to add your IP if you are not connecting from localhost.
            //'allowedIPs' => ['127.0.0.1', '::1'],
            'generators' => [
                'layuiCrud' => [ //生成器名称
                    'class' => 'Jsyqw\Layuigii\crud\Generator',
                    'templates' => [ //设置我们自己的模板
                        //模板名 => 模板路径
                        'layuiCrud' => '@vendor/layui-gii/src/crud/default',
                    ]
                ],
                'model' => [ //生成器名称
                    'class' => 'Jsyqw\Layuigii\model\Generator',
                    'templates' => [ //设置我们自己的模板
                        //模板名 => 模板路径
                        'layuiModel' => '@vendor/layui-gii/src/model/default',
                    ]
                ],
                'api' => [ //生成器名称
                    'class' => 'Jsyqw\Layuigii\api\Generator',
                ]
            ],
        ];
    ...
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Total

3

Last Release

2154d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56a4c0ae3dbcd1e806189f5c0b8a60543f35a786226aa267af1f8a8b55bd9af1?d=identicon)[jasonyqwang](/maintainers/jasonyqwang)

---

Top Contributors

[![jasonyqwang](https://avatars.githubusercontent.com/u/5234340?v=4)](https://github.com/jasonyqwang "jasonyqwang (35 commits)")

### Embed Badge

![Health badge](/badges/jsyqw-layui-gii/health.svg)

```
[![Health](https://phpackages.com/badges/jsyqw-layui-gii/health.svg)](https://phpackages.com/packages/jsyqw-layui-gii)
```

PHPackages © 2026

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