HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
index.php
Go to the documentation of this file.
1 <?php
5 $class = get_class($model);
6 Yii::app()->clientScript->registerScript(
7  'gii.crud',
8  "
9 $('#{$class}_controller').change(function(){
10  $(this).data('changed',$(this).val()!='');
11 });
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*$/));
16  if(id.length>0)
17  id=id.substring(0,1).toLowerCase()+id.substring(1);
18  controller.val(id);
19  }
20 });
21 "
22 );
23 ?>
24 <h1>Bootstrap Generator</h1>
25 
26 <p>This generator generates a controller and views that implement CRUD operations for the specified data model.</p>
27 
28 <?php
30 $form = $this->beginWidget('CCodeForm', array('model' => $model)); ?>
31 
32 <div class="row">
33  <?php echo $form->labelEx($model, 'model'); ?>
34  <?php echo $form->textField($model, 'model', array('size' => 65)); ?>
35  <div class="tooltip">
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.
39  </div>
40  <?php echo $form->error($model, 'model'); ?>
41 </div>
42 
43 <div class="row">
44  <?php echo $form->labelEx($model, 'controller'); ?>
45  <?php echo $form->textField($model, 'controller', array('size' => 65)); ?>
46  <div class="tooltip">
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:
49  <ul>
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,
54  it will generate <code>UserController</code> (and other CRUD code)
55  within the module instead.
56  </li>
57  </ul>
58  </div>
59  <?php echo $form->error($model, 'controller'); ?>
60 </div>
61 
62 <div class="row sticky">
63  <?php echo $form->labelEx($model, 'baseControllerClass'); ?>
64  <?php echo $form->textField($model, 'baseControllerClass', array('size' => 65)); ?>
65  <div class="tooltip">
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.
68  </div>
69  <?php echo $form->error($model, 'baseControllerClass'); ?>
70 </div>
71 
72 <?php $this->endWidget(); ?>