Git Product home page Git Product logo

giix's Introduction

giix Readme
===========

giix version 1.10 (dev, unstable)

giix official website:    http://giix.org/

You should always
download giix from:       http://www.yiiframework.com/extension/giix

giix on...
Yii Extension Repository: http://www.yiiframework.com/extension/giix/
Yii Forum:                http://www.yiiframework.com/forum/index.php?/topic/13154-giix-%E2%80%94-gii-extended/
Google Code:              http://giix.googlecode.com/
Ohloh:                    http://www.ohloh.net/p/giix

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.

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.

Also, thanks for the huge help from:
Thiago Talma (Athos)
Gustavo Salomé Silva (Gustavo)

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.
- 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().
- Bundled translations (pending support on Yii core as of Yii 1.1.8. See <http://code.google.com/p/yii/issues/detail?id=2624> for details).
- 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
--------

Always download the latest release from the extension page at:
http://www.yiiframework.com/extension/giix

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!

REQUIREMENTS
------------

Yii 1.1.9+ is required.

giix should run with:
- Yii 1.1.8+ (tested with revision 3364 + patch*)
- Linux
- Apache 2.2 or nginx 0.8+
- MySQL 5.x
- PHP 5.2+

giix may run on other setups, but there is no official suppport for them.
There is no planned official support for other setups, including Windows/IIS, XAMPP/etc or other DBMS.

* You can use giix with Yii 1.1.8 if you patch your Yii installation with the patch provided in the issue 2624:
<http://code.google.com/p/yii/issues/detail?id=2624>.

INSTALLATION AND UPGRADING
--------------------------

Please see INSTALL and UPGRADE files for instructions.

USING
-----

After installing, you will see the giix generators on the gii page.
The giix generators' names start with "giix".
Read the gii doumentation on how to use it
<http://www.yiiframework.com/doc/api/GiiModule>.

If you want to use the GxActiveRecord::saveWithRelated method, you must first generate
the pivot model for the cross-reference table of the relationship.
The pivot model class is the active record between two other active records that have
a MANY_MANY relationship.
If you have already generated models for every table in your schema, you are ready to
use the method to save your MANY_MANY relations.
If you use the support for saving MANY_MANY relations as generated, you will need to
manually write code to support scenarios. This is an important security concern.

DONATE
------

Go to <http://giix.org/> and donate via Flattr or via Paypal.

giix's People

Contributors

rcoelho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

giix's Issues

add phpdoc for variables in views

I would like to see variable documentation in the templates for crud generation like this:

<?php 
/* @var $model User */ 
/* @var $this UserController */
/* @var $form CActiveForm*/
?>

Undefined index 'ajax' in performAjaxValidation

giix-components/GxController.php line 160

...
if (Yii::app()->getRequest()->getIsAjaxRequest() && (($form === null) || ($_POST['ajax'] == $form)))
...

change:

($_POST['ajax'] == $form)

to:

(isset($_POST['ajax']) && $_POST['ajax'] == $form)

Unable to append MANY_MANY relationship

Hi there,

Just wondering if every time I save a new MANY_MANY relationship model, is it possible to preserve the old data? Each time I insert something new, say a new photo, which is linked by MANY_MANY relationship, the SaveRelated method will automatically remove all my old relation.

It is not practical to include all the data in my form every time when I just need to add something new. Perhaps you can add an "append" option in your SaveWithRelated and SaveRelated function, and use it to stop the deleting process?

I found nother SaveRelated extension from yii before, they are providing this feature where I found it quite useful, Please consider to modify it if possible.

Thank you.

Controller Scaffolding dropDownList forces 0:M relation to be 1:m

Method:
Set up a two linked tables with a nullable relation in database.

model is correctly scaffolded by giix where in rules, you can see that the relation is not marked as required.

When scaffolding the controller/view, does not add a null option to the top of the dropdown list because giix is automatically finding all possible attributes, but does not take into consideration if the field is nullable.

echo $form->dropDownList(
    $model, 
    'entity_id', 
    GxHtml::listDataEx(MODEL_NAME::model()->findAllAttributes(null, true))); ?>

Default values in model

What steps will reproduce the problem?

  1. In MySQL, create a table with one or more columns of type TINYINT(1) (intended for boolean), NOT NULL, and set a default value
  2. Use Giix to generate a model

What is the expected output?
The model should have a rule that sets those fields to their respective default values if empty.

What do you see instead?
A rule that sets them to NULL if empty.

What version of giix are you using?
1.9.1

What is your stack (operating system, web server, DBMS, PHP version)? MacOS, Apache2, MySQL 5.1.53, PHP 5.3.6
What version of the Yii Framework are you using? 1.1.9

Please attach your relevant source and configuration files and sql scripts.

CREATE TABLE `community_user` (
  `community_id` varchar(50) NOT NULL COMMENT 'The community',
  `user_id` int(10) unsigned NOT NULL COMMENT 'The existing user',
  `banned` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Defines if a user is banned from this specific community',
  `newsletter` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Is the user subscribed to the newsletter for this community',
  `email_notification` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT 'If the user accepts to receive notifications by email',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'The time the user joined this community',
  PRIMARY KEY (`community_id`,`user_id`),
  KEY `communityuser_user` (`user_id`),
  KEY `community_index` (`community_id`),
  CONSTRAINT `communityuser_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Defines which user belongs to which community';

GiixCrudCode checkbox labels

Hi! In GiixCrudCode class, methods generateGridViewColumn and generateSearchField generates labels for checkbox displays strict in English language. I offer to replace strict labels "No", "Yes" and "All" to Yii:t('app', ...). It'll support multilanguage in extension. Thanks!

Unable to resolve the request "gii/giixModel".

I've downloaded (actually cloned) giix from GitHub to my extensions directory and followed the installation instructions to the letter. At first I tried it without running the CPhpMessageSource.patch because comments seemed to suggest that the issue had been fixed. Then, I got the message "Unable to resolve the request "gii/giixModel" when trying to run GiixModel Generator.

I went back and applied the patch (although it took me quite a while to find CPhpMessageSource.php since I most definitely don't need the i18n functionality). I then tried to run GiixModel Generator again. Again, it gave me the error message Unable to resolve the request "gii/giixModel".

When I tried a "dry-run" on patch CPhpMessageSource.php, it returned the following message (which may be why the problem occurs):

$ patch -p0 --dry-run < CPhpMessageSource.patch
patching file CPhpMessageSource.php
Hunk #1 FAILED at 62.
Hunk #2 FAILED at 94.
2 out of 2 hunks FAILED -- saving rejects to file CPhpMessageSource.php.rej

Any suggestions on what I may be doing wrong or how I can get around this issue? This really looks like a wonderful extension. I would hope that the functionality would be incorporated into the Yii base soon.

bundle/include translation

An extension should come with translations included.

I am using giix as submodule and dont want to edit the messages folder because then I have to make changes and commit them somewhere that other clones can see those changes as well.

The messages folder should include the translations even if there are currently no translations in any/all languages

User and its behaviors do not have a method or closure named "label".

I've looked everywhere I can on Google and other places for a resolution to this problem, and while I can find several mentions of it, I can't seem to find any resolution. Basically, the problem is this:

  1. I have the Yii User and Rights modules installed and fully functional.
  2. I have Giix installed and fully functional (other than this issue).
  3. I have a model that is related to the User model in the User module.
  4. When I generate the model and CRUD for the related model, I receive an error message stating: User and its behaviors do not have a method or closure named "label".
    I've tried copying the entire attributeLabels() function from the base Model as some have suggested, but that has no effect at all.
    By the way, before I got this far, I got a message that User.php could not be found. I resolved that by adding Yii::import('application.modules.user.models.*'); to the relations() function in the model.
    When I generate the model and CRUD using pure Gii, I have no problems whatsoever, so I have to believe that Giix is at the core of the problem. (I thought about submitting this issue to the User module, but I have a feeling they would send me back to you guys.)
    Again, I looked everywhere for a resolution to this problem and couldn't find one, although many folks seem to be having it. Is there a resolution for this?

Checkbox list on HAS/MANY_MANY

Hi, i'm using this new version and I'm editing it to integrate with the bootstrap existing extension.

In my tests, however, I found that the records displayed by the method generateActiveRelationField (in update action) are not properly trimmed as checkboxes.

Only the first one is "checked".

Wrong bracket in GxActiveRecord:308

In fillPkColumnNames method

                                                                                                                                                                                                  vvv this bracket wrong
        throw new InvalidArgumentException(Yii::t('giix.messages', 'The count of values in the argument "pk" ({countPk}) does not match the count of columns in the composite PK ({countColumns}).'), array(
            '{countPk}' => count($pk),
            '{countColumns}' => $columnCount,
        ));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.