Models in Yii Modules

Yii Create Module using CRUD step by Step

Firstly create a module using Gii
screenshot_76I think this might be helpful how to create CRUD for modules in Yii.How to use Yii framework in modules

Create a table in database
"CREATE TABLE oow(id INTEGER PRIMARY KEY NOT NULL, serial_number TEXT, model_number TEXT, mdel_range TEXT, notes TEXT, created DATETIME ,modified DATETIME, createdby INTEGER, modifiedy INTEGER )"

Next Create Model for your table in moudule you just created. Make sure to change the model path to application.modules.YOURMODULENAME.models and click on Generate

Last thing is to create the CRUD
Make sure you give model class name as
else it will give error as model not found while creating CRUD


You can now run your moudule as

If you are using SEO friendly URLs you probably need to change code as per your main.php in config folder

I hope this will help you