pcrt / yii2-gii

Yii2框架的替代Gii生成器

1.0.9 2020-06-09 17:44 UTC

This package is auto-updated.

Last update: 2024-09-29 05:28:12 UTC


README

额外的Gii代码生成器。

此扩展向Yii2框架的Gii扩展添加代码生成器。

##安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

$ php composer.phar require pcrt/yii2-gii "*"

"pcrt/yii2-gii": "*"

将其添加到您的 composer.json 文件的“require”部分。

用法

安装扩展后,修改您的应用程序配置以包含

  $config['modules']['gii'] = [
      'class' => 'yii\gii\Module',
      ....
      'generators' => [ // HERE
          'pcrtmodel' => [
              'class' => 'pcrt\generators\model\Generator',
              'templates' => [
                  'pcrt' => '@vendor/pcrt/yii2-gii/generators/model/pcrt',
              ]
          ],
          'pcrtcrud' => [
              'class' => 'pcrt\generators\crud\Generator',
              'templates' => [
                  'pcrt' => '@vendor/pcrt/yii2-gii/generators/crud/pcrt',
              ]
          ]
      ],
      ....
      // uncomment the following to add your IP if you are not connecting from localhost.
      // 'allowedIPs' => ['127.0.0.1', '::1'],
  ];

许可证

Yii2-gii 在 BSD-3 许可证下发布。有关详细信息,请参阅捆绑的 LICENSE.md 文件。

享受吧!