awegen is an intelligent code generator for Yii framework with optional Twitter Bootstrap support.
awegen borrows goodies from giix and gtc.
[Note: This extension isn’t maintained any more.]
What awegen does?
- Generates textarea for
Genearates textarea with markitup editor for
longtextdb type. (Uses markitup widget.)
- Generates checkbox for
Uses JToggleColumn for
booleantypes in Admin/CGridView. (Uses JToggleColumn extension.)
- Generates fields with Datepicker for
Generates fields with Datetimepicker for
timestampdb type. (Uses datetimepicker widget.)
Allows easy addition of access control templates in the generator. (
Users can add templates into
AweCrud/templates/default/authfolder and they will be listed in the CRUD generator.)
- Guesses e-mail fields by field names and adds e-mail validation for forms and mailto links for views.
- Guesses image fields by field names and tries to display the image in views.
- Guesses url fields by field names and adds url validation for forms and creates links for views.
- Guesses password fields by field names, generates password fields for them in forms and hides them from non-admin users in views.
- Guesses createtime and updatetime fields and adds proper timestamp behaviour to them.
- Uses Activerecord-relation-behavior to handle all kinds of relations.
- Creates pulldown menu for one-to-many and one-to-one relations.
- Creates checkboxes for fields with many-to-many relations.
- Keeps generated code in abstract base model so that regeneration doesn’t overwrite user changes.
- Guesses identification column for models and uses them in headings and breadcrumbs. (Looks for following fields in order of priority – name, title, slug, any field with name in its name, first non-numeric field, primary key.)
- Handles parent-child relationship of items among same model. (Allows an item to be parent/child of any other items from the same table but not itself.)
Download from https://github.com/xtranophilist/awegen/zipball/master.
Extract the awegen folder from the archive to extensions directory of your application.
Add the path of awegen to generatorPaths section in gii module
'modules' => array( 'gii' => array( 'class' => 'system.gii.GiiModule', 'password' => 'password', 'generatorPaths' => array( 'ext.awegen', ), ), ... ),
Add the components required to your imports section:
'import' => array( ... 'application.extensions.awegen.components.*', ),
/gii, login and select AweModel Generator to
create Model and then AweCrud to generate Controller and Views.
* for table name in Model generator to preview all
models. Generate all or selectively.
Credits to @bunkdeath for helping me with this.