index.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <h1>Form Generator</h1>
  2. <p>This generator generates a view script file that displays a form to collect input for the specified model class.</p>
  3. <?php $form=$this->beginWidget('CCodeForm', array('model'=>$model)); ?>
  4. <div class="row">
  5. <?php echo $form->labelEx($model,'model'); ?>
  6. <?php echo $form->textField($model,'model', array('size'=>65)); ?>
  7. <div class="tooltip">
  8. Model class is case-sensitive. It can be either a class name (e.g. <code>Post</code>)
  9. or the path alias of the class file (e.g. <code>application.models.LoginForm</code>).
  10. Note that if the former, the class must be auto-loadable.
  11. </div>
  12. <?php echo $form->error($model,'model'); ?>
  13. </div>
  14. <div class="row">
  15. <?php echo $form->labelEx($model,'viewName'); ?>
  16. <?php echo $form->textField($model,'viewName', array('size'=>65)); ?>
  17. <div class="tooltip">
  18. This refers to the name of the view script to be generated, for example,
  19. <code>site/contact</code>, <code>user/login</code>. The actual view script file will be generated
  20. under the View Path specified below.
  21. </div>
  22. <?php echo $form->error($model,'viewName'); ?>
  23. </div>
  24. <div class="row sticky">
  25. <?php echo $form->labelEx($model,'viewPath'); ?>
  26. <?php echo $form->textField($model,'viewPath', array('size'=>65)); ?>
  27. <div class="tooltip">
  28. This refers to the directory that the new view script file should be generated under.
  29. It should be specified in the form of a path alias, for example, <code>application.views</code>,
  30. <code>mymodule.views</code>.
  31. </div>
  32. <?php echo $form->error($model,'viewPath'); ?>
  33. </div>
  34. <div class="row">
  35. <?php echo $form->labelEx($model,'scenario'); ?>
  36. <?php echo $form->textField($model,'scenario', array('size'=>65)); ?>
  37. <div class="tooltip">
  38. This refers to the scenario in which the model should be used to collect user input.
  39. For example, a <code>User</code> model can be used in both <code>login</code> and <code>register</code> scenarios.
  40. To create a form for the login purpose, the scenario should be specified as <code>login</code>.
  41. Leave this empty if the model does not need to differentiate scenarios.
  42. </div>
  43. <?php echo $form->error($model,'scenario'); ?>
  44. </div>
  45. <?php $this->endWidget(); ?>