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




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s