clientScript->registerScript('gii.crud'," $('#{$class}_controller').change(function(){ $(this).data('changed',$(this).val()!=''); }); $('#{$class}_model').bind('keyup change', function(){ var controller=$('#{$class}_controller'); if(!controller.data('changed')) { var id=new String($(this).val().match(/\\w*$/)); if(id.length>0) id=id.substring(0,1).toLowerCase()+id.substring(1); controller.val(id); } }); "); ?>

Crud Generator

This generator generates a controller and views that implement CRUD operations for the specified data model.

beginWidget('CCodeForm', array('model'=>$model)); ?>
labelEx($model,'model'); ?> textField($model,'model',array('size'=>65)); ?>
Model class is case-sensitive. It can be either a class name (e.g. Post) or the path alias of the class file (e.g. application.models.Post). Note that if the former, the class must be auto-loadable.
error($model,'model'); ?>
labelEx($model,'controller'); ?> textField($model,'controller',array('size'=>65)); ?>
Controller ID is case-sensitive. CRUD controllers are often named after the model class name that they are dealing with. Below are some examples:
error($model,'controller'); ?>
labelEx($model,'baseControllerClass'); ?> textField($model,'baseControllerClass',array('size'=>65)); ?>
This is the class that the new CRUD controller class will extend from. Please make sure the class exists and can be autoloaded.
error($model,'baseControllerClass'); ?>
endWidget(); ?>