How to generate crud in modules folder in yii

I am trying to create CRUD through GII in the YII Framework in the modules folder. But there is one option for changing the CRUD path.

+7
source share
6 answers

I also looked around. Hope this helps.

  • Create a module through the module generator.
  • Register your module name in the config.php file (modules array)
  • Create a model using the model generator. Fill in the fields and put them in Model Path: application.modules. [Module-name] .models
  • Create a crud through the Crud Generator. Fill in the fields and put them in Model Model: [module-name] .models. [Model-name]

Sorry, the link is in Indonesian. A source

+9
source
  • Create a module through the module generator.
  • Register your module name in the config.php file (modules array)
  • Create a model using the model generator. Fill in the fields and put them in Model Path: application.modules. [Module-name] .models
  • Create a crud through the Crud Generator. Fill in the fields and put them in Model Model: [module-name] .models. [Model-name] add the module name to the controller ID: [module-name] / [controller-name]
+7
source
  • module-name/user generates module-name/UserController.php . If the application has a module-name , it will generate a UserController (and other CRUD code) in the module-name .
+4
source

It might be useful to create controllers

controller help

how can you get its controller and browse inside the module you want. As for the models, I agree with the previous answers.

Byee

+1
source

Model Class: user_access.models.User

Controller ID: user_access / user

0
source

Model Class: application.modules.guestbook.models.Guestbook

Controller ID: Guestbook / Default

Note: guestbook is my module name, and I created crud directly in the guestbook folder using the above path.

0
source

All Articles