title: yii : how to get the post data?
body: <p>Status : created a form with items list by ajax. Adding new item into form is working fine. calculating is working fine. but can't get the added item at controller (create).</p>
  
  <p>Q : How can I get the data at controller from view's post?</p>
  
  <p>This is my view.</p>
  
  <pre><code>&lt;div class="form"&gt;
  
  &lt;?php $form=$this-&gt;beginWidget('CActiveForm', array(
      'id'=&gt;'acc-recei-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;?php
      Yii::app()-&gt;clientScript-&gt;registerScript('add-item', "
          $('#add-item').click(function(){
  
              //console.log(item_template);
              $('#template .template_item').clone().appendTo('#item_list');
              $('#item_list .template_item').fadeIn();
  
  
              return false;
          });
  
          $('.item-name').live('change', function(){
              var itemID = $(this).val(),
                  vNode  = $(this);
              $.ajax({
                  url: 'getitem/'+itemID,
                  dataType: 'json',
                  success: function(data){
                      var target = $(vNode).parents('tr');
                      //console.log('target tr: ' + target);
                      $(target).find('.price').text(data.item_price);
                  }
              });
  
          });
  
          $('.qty').live('keyup', function(){
            var vNode  = $(this);
            var vQty = $(this).val();
            var target = $(vNode).parents('tr');
            var vPrice = $(target).find('.price').text();
  
            //console.log($(target).find('.price').text());
  
            var vrowtotal = vQty * vPrice;
            $(target).find('.row_total').text('$ ' + vrowtotal);
             findTotals();
          });
  
          function findTotals() {
  
              var subTotal = '';
              $('#item_list tr.template_item').each(function() {
  
                  //console.log($('.row_total').text());              
                  var row_total = 0,
                          price = Number($('.price',this).text());
                          qty   = Number($('.qty',this).val());
  
                      row_total = price*qty; 
                      subTotal = Number(row_total) + Number(subTotal);
              });
              subTotal = Number(subTotal);
              $('#grandtotal').text('$ '+ subTotal);
  
          }
  ");
  
  
      ?&gt;
  &lt;table id="item_list" name="item_list[]"&gt;
  &lt;tr class="item_list"&gt;
      &lt;td&gt;name&lt;/td&gt;
      &lt;td&gt;price&lt;/td&gt;
      &lt;td&gt;qty&lt;/td&gt;
      &lt;td&gt;row_total&lt;/td&gt;
  &lt;tr&gt;
  &lt;/table&gt;
  &lt;label id="grandtotal"&gt;&lt;/label&gt;
      &lt;p align="right"&gt;
          &lt;?php echo CHtml::link('Add Item','#',array('class'=&gt;'btn btn-info', 'id'=&gt;'add-item')); ?&gt;
      &lt;/p&gt;
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'acc_category_id'); ?&gt;
          &lt;?php
              echo $form-&gt;dropDownList($model,'acc_category_id', $acccategorieslist, array(
              'prompt'=&gt;'Please select a category',
              'options'=&gt;array("$model-&gt;acc_category_id"=&gt;array('selected'=&gt;'selected')),
              )
          ); 
          ?&gt;
          &lt;?php echo $form-&gt;error($model,'acc_category_id'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'customer_id'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'customer_id',array('size'=&gt;11,'maxlength'=&gt;11)); ?&gt;
          &lt;?php echo $form-&gt;error($model,'customer_id'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'job_id'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'job_id',array('size'=&gt;11,'maxlength'=&gt;11)); ?&gt;
          &lt;?php echo $form-&gt;error($model,'job_id'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'accmain_id'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'accmain_id',array('size'=&gt;11,'maxlength'=&gt;11)); ?&gt;
          &lt;?php echo $form-&gt;error($model,'accmain_id'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'date'); ?&gt;
          &lt;div class="controls"&gt;
          &lt;?php 
              $this-&gt;widget('zii.widgets.jui.CJuiDatePicker', array(
                  'name'=&gt;'AccRecei[date]',       
                  'model'=&gt;$model,
                  'value' =&gt; $model-&gt;date,    
                  'options'=&gt;array(
                      'showAnim'=&gt;'fold',
                      'dateFormat' =&gt; 'dd-mm-yy',                   
                  ),
                  'htmlOptions'=&gt;array(
                      'style'=&gt;'height:20px;'
                  ),
              ));
              ?&gt;
  
          &lt;p&gt; Expire Date should not be Current Date.&lt;/p&gt;
          &lt;/div&gt;
          &lt;?php echo $form-&gt;error($model,'date'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'status'); ?&gt;
          &lt;?php echo $form-&gt;dropDownList($model,'status', $arr_status, array('prompt'=&gt;'Please select a status')); ?&gt;
          &lt;?php echo $form-&gt;error($model,'status'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'description'); ?&gt;
          &lt;?php echo $form-&gt;textArea($model,'description',array('rows'=&gt;6, 'cols'=&gt;50)); ?&gt;
          &lt;?php echo $form-&gt;error($model,'description'); ?&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;
  
  &lt;table id="template" style="display:none;" &gt;
  &lt;tr class="template_item"&gt;
      &lt;td&gt;&lt;?php
              echo $form-&gt;dropDownList(
                  $model,
                  'item_name', 
                  $accitemslist, 
                  array(
                      'prompt'=&gt;'Please select a category',
                      'options'=&gt;array("$model-&gt;acc_category_id"=&gt;array('selected'=&gt;'selected')),
                      'class'=&gt;'item-name',
                      )                                    
                  ); 
          ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;label id="price" class="price"&gt;&lt;/label&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="item_qty[]" class="qty" /&gt;&lt;/td&gt;
      &lt;td&gt;&lt;label id="row_total" class="row_total"&gt;&lt;/label&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This is my controller </p>
  
  <pre><code>public function actionCreate()
      {
          $model=new AccRecei;
  
          // Uncomment the following line if AJAX validation is needed
          // $this-&gt;performAjaxValidation($model);
  
          if(isset($_POST['AccRecei']))
          {
              //$model-&gt;attributes=$_POST['AccRecei'];
              //if($model-&gt;save())
                  //$this-&gt;redirect(array('view','id'=&gt;$model-&gt;id));
  
              var_dump($_POST['AccRecei']);
          }
  
          $records = AccCategory::model()-&gt;findAll();
          $acccategorieslist = CHtml::listData($records, 'id', 'name');
  
          $records = AccItem::model()-&gt;findAll();
          $accitemslist = CHtml::listData($records, 'id', 'name');
  
          $arr_status = array('Open'=&gt;'Open', 'Close'=&gt;'Close', 'Late'=&gt;'Late', 'Draft'=&gt;'Draft', 'Partial'=&gt;'Partial');
          $this-&gt;render('create',array(
              'model' =&gt; $model,
              'acccategorieslist' =&gt; $acccategorieslist,
              'accitemslist'=&gt;$accitemslist,
              'arr_status'=&gt; $arr_status,
          ));
      }
  </code></pre>