Help test gii: a web-based code generator

gii is a framework for web-based code generators.

It allows you to use more interactive Web interfaces to control how new code should be automatically generated.

It is also highly customizable and extensible, which allows you to easily generate the code in your own style and fit for your needs.

Please help us test this new feature, and let us know your suggestions.

gii is currently available only in svn trunk. To use gii, simply modify your app config by adding the ‘gii’ module like the following:




return array(

   'modules'=>array(

       'gii'=>array(

           'class'=>'system.gii.GiiModule',

           'password'=>***choose a password***

       ),

   ),

);



You can then access gii via URL: /index.php?r=gii

Nice. Thank you.

As it is now, I don’t see how to create say backend/controllers/MyControllerController. Or am i missing something?.

@abajja

For that you can configure the Gii module to run from the backend itself. In other words, in backend/config/main.php. Then run Gii from backend/index.php?r=gii

Oh exciting tool: I’m updating my trunk and test! :)

I’m still not clear - what exactly does this do?

what is the future plan?

will it have the same funcionallities as the command line tool?

The only thing that is missing is Model generator. It will be very useful if there is web interface for creating tables for CActiveRecord classes.

Very nice improvement to the yiic command line tool.

Cool logo by the way ;)

Just a tip for you people who do not run your dev server on localhost:

If you are not running Yii on localhost you need to add an ip filter rule to get access to the Gii module. By default Gii only allows connections from localhost.

Change your config file to look something like this:




       'gii'=>array(

           'class'=>'system.gii.GiiModule',

           'password'=>'your_password',

           'ipFilters'=>array('192.168.175.1'), //Add your client IP here

       ),



/John

Thank you Jonah. that’s resolved the problem.

But I still want to know if it 's possible to control the folders creation.

An other observation: I dont see why gii write to the disk runttime/gii/ControllerCode.php (etc.), as it overrides them as soon as you do preview or generate.

Last I think more features are coming.

gii will replace the yiic generators, and it offers more (of course). We will add the model generator for sure. The current interfaces are more like translating from the yiic generators. In the future, we may consider adding more customization options (such as specifying the validation rules/attribute types, etc.)

@abajja: those runtime writings are for "sticky attribute" feature. That is, it will remember your last input. For example, if you have multiple sets of code template for the same generator, and you pick up one during this time, then next time when you use the generator again, it will remember the choice you made last time.

This is really cool! So is the new logo!

Any kind of rough ETA on when this might be released?

When generating a form I think the message is wrong on the screen that appears after the form is successfully created.

Have a look at the attached file. Shouldn’t it be the word form instead of module?

608

form_error.PNG

Thanks. Fixed it.

We hope to release gii in 1.1.2.

Sweet! That is exciting. Thank you.

Thank you qiang for the explanation. I did some modificactions and the results are as in image attached.

Very nice feature.

Very nice. I guess it’s a matter of time before Gii is a full IDE for Yii. :)

Is it possible to add RBAC support, something like this:

  • define a (fixed) operation id (e.g. op_developer_gii, or op_gii, or …)

  • in the module add an attribute ‘use rbac’ to differentiate between rbac and the current access control

  • in the controller add an access control filter which filters on role ‘op_gii’ only if ‘use rbac’ is true.

  • change the ‘default/login’ action to forward a call to the default application login if ‘use rbac’ is true, else use the current gii login form

Keep up the good work for us!

gii is meant to be a development tool, while RBAC management is part of application logic. Therefore, we do not want to mix them together.

In future, we may consider providing a skeleton application that has commonly needed features, such as user management, content management, RBAC management, log management, statistics, and so on.

Hi Qiang, this is really promising!

I just wanted to know if there is a public "Roadmap"?

Thank you very much for all your work and your team!

Regards,

Luis

Hey Qiang, when you said gii will replace yiic generators, did you mean yiic generators will be removed form the framework completely?