giix is gii Extended, a code generator for Yii PHP framework.
Overview ¶
giix is gii Extended, a code generator for Yii PHP framework.
giix is inspired and based on gii-template-collection (gtc), by Herbert Maschke (thyseus).
giix is free software and is dual-licensed under the terms of the new BSD License and under the terms of GNU GPL v3. See the LICENSE file.
Links ¶
Forum discussion for giix
giix on GitHub

Starting with Yii? Read The complete beginner's study guide for the Yii Framework
Latest news ¶
giix 1.9.1 is here. It fixes the issue #23.
Acknowledgements ¶
giix is inspired and uses code from Yii PHP framework and gii-template-collection.
Many thanks to Qiang Xue, Herbert Maschke and the contributors of these software.
Features ¶
giix extends Yii's gii by providing:
- Proper handling of related model attributes, rendering appropriate form fields based on relation type.
- More support for HAS_MANY and MANY_MANY relations.
- Native support for saving MANY_MANY relations with the new method GxActiveRecord::saveWithRelated.
- Native support for saving multiple (related or not) records with the new method GxActiveRecord::saveMultiple (this method has known bugs, avoid using it).
- Automatic string representation for a model via GxActiveRecord::representingColumn() and GxActiveRecord::__toString().
- Better i18n support and easier to maintain: support to active record labels. You change the label once in the model and it is automatically updated in the views. This is especially useful for plurals.
- Out-of-the box i18n support by using Yii::t().
- Appropriate form fields are rendered based on model attribute/table field data type.
- Separated model and basemodel. Basemodel can be regenerated without overwriting your code in the model.
- Smart methods can query your database for just the needed data (usually the primary key and the field with the string representantion), avoiding manual setup or a "select *".
- Extensive use of default method parameters. Appropriate data is found automatically.
- Some (incipient) support for tables with composite primary keys.
- Generated code is completely free from styling and formatting. Your CSS controls the presentation.
- Generated code is (almost) free of comments.
- Well documented and commented source code. Ohloh says that 40% of the lines in the code are comments! You can understand and modify anything you want.
And a lot more! Read the CHANGELOG file and the (richly commented) source code to fully leverage giix's power.
Some of these features come from gtc.
Warnings ¶
giix is not fully tested now, so please test your application and be careful using it.
giix is still in development. Some changes may break backwards compatibility.
Are you upgrading? Please don't forget to read the UPGRADE file for instructions!
Some users reported problems extracting the files from the archive.
Please download the free 7-zip version 9.20, it is reported to work well.
Installation and upgrading ¶
Please see INSTALL and UPGRADE files for instructions.
Please check the README file for more information.
Related wiki pages ¶
Extensions based on giix ¶
Apps powered by giix ¶
Reactions ¶
Already using giix? ¶
Show how you love giix on the forum and on this extension page
Upvote giix
Made in Brazil by mentel (Rodrigo Coelho)
Icons by famfamfam.com
Total 20 comments
Hi!
Just a question : can I use saveWithRelated for a MANY_MANY relation with data. For instance :
Can I use saveWithRelated to save one person with all the movies he has seen and the relation data (date and liked wich cannot be null)?
If not, how to do it nicely?
Cheers!
For "Property "CPhpMessageSource.extensionBasePaths" is not defined.", there is no property "extensionBasePaths", based on yii-1.1.13.e9e4a0, framework/i18n/CPhpMessageSource.php:
so the config should actually be
This might have solved @evan108108's issue. Hopefully it can help someone else.
Thanks for your codes.
like I've said many people don't know how to used giix properly :)
@bryglen, I never change the BaseClass.
I generate constantly new BaseClasses and I almost never lose the settings of the child classes. Of course I always do a basic review. To this I do a merge (CMap::mergeArray()) of the corresponding function of the parent class to the child class.
See this example, I have an UserBase.php (intact ) and my User.php:
In case of conflict you can remove an entry from the BaseModel without editing it using the function array_diff():
This code remove the rule from parent rules function:
That way I avoid the conflict of two messages appear for the same validation error.
Hope this help
Can you add a tutorial how people will override and inherit without modifying the BaseClass
I've still seen a lot of people don't know how to override and inherit and it's great if you put it on your extension.
by model generation.
Source File
C:\wamp\www\pr3\protected\extensions\giix-core\giixModel\GiixModelCode.php(67)
00067: $this->relations = $this->generateRelations();
what have I done wrong...?
thanks!
Agreed, @ktwbc. This feature will be present in a future release of giix. Thanks for the suggestion!
The Giix extension is nice, but one thing that would help would be a quick way to select only the changed Base classes. When I modify my tables, and have to regenerate with Giix, it's showing all the child classes in red (of course because that's where my model logic is), but I have to hunt for the /Base versions throughout the list. You need a "Select All (Changed) Base" button.
hi, there's a js error "TypeError: g.nodeName is undefined" dropped by the CJuiAutoComplete widget in giixModel/views/index.php, preventing the suggestion of the model class name. Latest Yii 1.1.12 is used.
I made a quick fix, replacing the row
$(this).val($(ui.item).val());
to
$(this).val(ui.item.value);
Great extension btw!
Thanks you! This is an excellent extension.
First of all, this is an awesome extension. It saved me a lot of time (and head scratching). Thumbs up!
"http://dl.dropbox.com/u/47099316/yii/bootstrap.rar"
@olivier.marian: relations are automatically built using InnoDB / your DB's specified relationships. So if you set up the relationships in the database, things will work fine. Also, please note we're trying to keep support questions on the forum thread as much as possible. Thanks!
Hello, first thank you very much for this extension that helps start with iii and have a nice app quite fast.
EDITED: I have a question though, and moved it to the forum here
Thank you again for your work, and your help. best regards. Olivier
Please open a new issue and send as much information as possible so I can work on the bug. Thanks!
Yeah I am using version 1.9.1 downloaded from this page
Are you using the trunk version? If so, please download giix from this page and install again.
I continually get this error:
Property "CPhpMessageSource.extensionBasePaths" is not defined.
Model generation works fine. This is a CRUD issue and it happens on preview.
Any help solving this would be great.
YEAH! perfect! at last :-) imho all yii plugins should be moved to github :-)
Leave a comment
Please login to leave your comment.