6 Yii::app()->clientScript->registerScript(
9 $('#{$class}_controller').change(function(){
10 $(this).data('changed',$(this).val()!='');
12 $('#{$class}_model').bind('keyup change', function(){
13 var controller=$('#{$class}_controller');
14 if(!controller.data('changed')) {
15 var id=new String($(this).val().match(/\\w*$/));
17 id=id.substring(0,1).toLowerCase()+id.substring(1);
24 <h1>Bootstrap Generator</h1>
26 <p>This generator generates a controller and views that implement CRUD operations
for the specified data model.</p>
30 $form = $this->beginWidget(
'CCodeForm', array(
'model' => $model)); ?>
33 <?php echo
$form->labelEx($model,
'model'); ?>
34 <?php echo
$form->textField($model,
'model', array(
'size' => 65)); ?>
36 Model
class is case-sensitive. It can be either a class name (e.g. <code>Post</code>)
37 or the path alias of the class file (e.g. <code>application.models.Post</code>).
38 Note that
if the former, the class must be auto-loadable.
40 <?php echo
$form->error($model, 'model'); ?>
44 <?php echo
$form->labelEx($model,
'controller'); ?>
45 <?php echo
$form->textField($model,
'controller', array(
'size' => 65)); ?>
47 Controller ID is
case-sensitive. CRUD controllers are often named after
48 the model
class name that they are dealing with. Below are some examples:
50 <li><code>post</code> generates <code>PostController.php</code></li>
51 <li><code>postTag</code> generates <code>PostTagController.php</code></li>
52 <li><code>admin/user</code> generates <code>admin/
UserController.php</code>.
53 If the application has an <code>admin</code> module enabled,
55 within the module instead.
59 <?php echo $form->error($model, 'controller'); ?>
62 <div class="row sticky">
63 <?php echo $form->labelEx($model, 'baseControllerClass'); ?>
64 <?php echo $form->textField($model, 'baseControllerClass', array('size' => 65)); ?>
66 This is the class that the new CRUD controller class will extend from.
67 Please make sure the class exists and can be autoloaded.
69 <?php echo $form->error($model, 'baseControllerClass'); ?>
72 <?php $this->endWidget(); ?>