April 15, 2009, 8:24pm
Hi Yall -
This framework is great so far but I'm tripping up when trying to create a module.
I recognize that this is a new feature, and I can see that the process for creating a module assumes a bit more fluency with Yii than what I currently have.
I used the yiic to get the module set up, but how would I go about implementing a module in an application?
Say for example the TestDrive application thats in the 'Definitive Guide' - how would I be able to set up a module and get a link to it and have it display in that context?
Any help would be appreciated.
April 15, 2009, 8:37pm
After you enter into "yiic shell" of the testdrive, you can use "module test" to create a module named "test". Then modify your app config to enable this module. You will be able to access the 'default' controller of the module using: /index.php?r=test or /index.php?r=test/default
April 21, 2009, 7:30pm
so i need to create models, views and controllers inside my module similar to what i would do for the root of the app?
do i need a layout and index file in there?
April 21, 2009, 8:12pm
Please check the 'help' information for 'controller', 'model' and 'crud' commands about how to create the classes for a module.
No, you don't need a layout for module. The application layout will be used by default.