I created a model called "User" and a module called "admin".
When I try to create the CRUD, and enter “admin” as the module ID (as below), I get the error “Module ‘admin’ does not exist.”… but it certainly does. Any thoughts?
Base Controller Class
Widget Used in Index Page
you need to include module name in crud fields where it asks where model name
I tried to create another User Model in the admin module, but that seems wrong to me… it also failed in the same way
I just want the user-management CRUD to be in the Admin module… but the User model is a sitewide model, and is accessed by a standard User Controller as well, for regular end-user functions…
Does that make sense?
Keep the User model in site models and generate crud controller as
by setting model path as
You need to first setup/add the module in the modules section of your application Yii Config file before running gii.
'modules' => [
'admin' => [
'class' => '\app\modules\admin\Module'
DOH! You are totally right! Nice call… thanks very much