PHP code example of jsyqw / layui-gii

1. Go to this page and download the library: Download jsyqw/layui-gii library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jsyqw / layui-gii example snippets


    ...
    $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',
                    ]
                ]
            ],
        ];
    ...

    ...
    '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'),
    ...

    ...
    $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',
                ]
            ],
        ];
    ...