1. 复制gii默认模板将vendoryiisoftyii2-giigeneratorscruddefault拷贝一份到backendviews下。这里我命名为_gii
2. 修改配置支持
代码语言:javascript复制修改environmentsdevbackendconfigmain-local.php
$config['modules']['gii'] = [
'class' => 'yiigiiModule',
'generators' => [
'crud' => [
'class' => 'yiigiigeneratorscrudGenerator',
'templates' => [
'myCrud' => '@backend/views/_gii/generators/crud/default',
]
]
],
];
3. 然后就可以自定义模板了~
4. 切勿忘记重新执行一下init.bat的dev模式
(完)