Gii -views not autogenerate inside module


Using Gii module i created controllers,views and modules,But when creating a Crud inside a module it only generate controller and also there is some difference in crud generator in Yii2 tutorial and one i installed.

screenshots are attached.


I think views may be copied inside application view not inside module views :)

Just guess…check once

ok right,but need to specify the path of view to generate.

You need to specify the full OS path to the module’s views directory when using Yii’s Gii when generating CRUD for a module. It will successfully put the views in the correct module directory when you do. This includes the views of nested modules (modules within a module). If you do not, the views will be placed in the application’s views directory.

If using Warrence’s Kartik Gii, the views for top level modules will be placed in the correct module directory. But for nested modules (a module within a module), the views will be placed in the application’s views directory and will have to be moved manually. The difference here is that Warrence’s version of Gii is based on an earlier version of Gii and does not include a field for specifying the views directory. Also, it will not accept the module id of a nested module. However, the comments in the view files will reflect the correct view location, so you can just move them.

Great! mmx, it solved my problem.

thanks ‘mmx’, now it works