title: Yii app how to make hidden field for date current date in create view?
body: <p>I created model view and controller for advertise.
  i want a date in add table as current date.
  in view generated by gii it displays text input field.
  how can i make it hidden so that it can get current date without taking input from user??
  what should I change?
  help me please. this is not a complex but i getting confused.. thanks </p>
  
  <p><strong>view/_form.php</strong> </p>
  
  <pre><code>&lt;div class="form"&gt;
  
  &lt;?php $form=$this-&gt;beginWidget('CActiveForm', array(
  'id'=&gt;'add-form',
  'enableAjaxValidation'=&gt;false,
  )); ?&gt;
  
  &lt;p class="note"&gt;Fields with &lt;span class="required"&gt;*&lt;/span&gt; are required.&lt;/p&gt;
  
  &lt;?php echo $form-&gt;errorSummary($model); ?&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'username'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'username',array('size'=&gt;50,'maxlength'=&gt;50)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'username'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'addname'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'addname',array('size'=&gt;60,'maxlength'=&gt;100)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'addname'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'category'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'category',array('size'=&gt;60,'maxlength'=&gt;100)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'category'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'description'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'description',array('size'=&gt;60,'maxlength'=&gt;1000)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'description'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'city'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'city',array('size'=&gt;50,'maxlength'=&gt;50)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'city'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'address'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'address',array('size'=&gt;60,'maxlength'=&gt;500)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'address'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'mobile'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'mobile',array('size'=&gt;60,'maxlength'=&gt;100)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'mobile'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'email'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'email',array('size'=&gt;60,'maxlength'=&gt;100)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'email'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'image'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'image',array('size'=&gt;60,'maxlength'=&gt;100)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'image'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'price'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'price',array('size'=&gt;60,'maxlength'=&gt;100)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'price'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'createtime'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'createtime'); ?&gt;
      &lt;?php echo $form-&gt;error($model,'createtime'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row buttons"&gt;
      &lt;?php echo CHtml::submitButton($model-&gt;isNewRecord ? 'Create' : 'Save'); ?&gt;
  &lt;/div&gt;
  
  &lt;?php $this-&gt;endWidget(); ?&gt;
  
  &lt;/div&gt;&lt;!-- form --&gt;
  </code></pre>