how do I automatically create a channel (or Controller in CodeIgniter terms) using a module?
I am creating a module that I am going to use on a number of different projects. It’s basically going to show item details.
I am hoping to have accessible via a channel, once the module is installed, a form that I create to Add, Edit and delete these items.
Is it possible to have the channel (with a View loaded in) automatically set up via module (so I don’t have to recreate the channels on every install of the module)? How do I do it?
thanks for the help!
-Jayson
Hi,
in your upd.modulename.php install() function you’ll have to insert the necessary info into exp_channels, and then maybe also exp_field_groups and exp_channel_fields. I’d do a mysqldump of the db, then create a channel/fields with all the info you want, then do another db dump and then compare the two to know what you need to add in your install() function.
Check out devkit to generate the module skeleton: http://www.bybjorn.com/344/
😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.