warrence / yii2-kartikgii

Gii CRUD Generator base on kartik-v extension
BSD 3-Clause "New" or "Revised" License
33 stars 39 forks source link

No views path causes problems for nested modules #6

Open mmx3 opened 9 years ago

mmx3 commented 9 years ago

The CRUD generator does not support a 'views' path like Gii, so for nested modules, I have not been able to discover where it places the views. As a result, the nested modules have to be created at the top level of the modules hierarchy, then your config file module entries and all of the module files need to be changed to reflect the correct namespaces and paths used for the nested modules. Other than that, the generator works great.

The generation results for a nested module are as follows:

Generating code using template "C:\xampp\htdocs\amber\vendor\warrence\yii2-kartikgii\crud/default"... generated C:\xampp\htdocs\amber\backend\modules\admin\modules\audit\controllers\AuditController.php generated C:\xampp\htdocs\amber\backend\modules\admin\modules\audit\models\AuditSearch.php generated views\audit_form.php generated views\audit_search.php generated views\audit\create.php generated views\audit\index.php generated views\audit\update.php generated views\audit\view.php done!

mmx3 commented 9 years ago

It does generate the views but puts them in the views directory of the frontend, but the CRUD was generated for the backend. The controllers and ModelSearch files were generated in the backend.

The Module ID field will not accept the name of a nested module even though the module is nested in a 'modules' => [] section within the parent module. Note that Gii does not have this problem.

In any case the view files were found and moved to the correct location with no problem. kartik-gii does add the correct paths for the model in the various view files.