title: In yii how to send json in required format
body: <p>I am working in Yii framework. I am having following function-</p>
  
  <pre><code>public function actionGetPublicPoll()
  {
      $model=new poll();
      $polltype=Poll::model()-&gt;findAllByAttributes(array("pollTypeId"=&gt;1));
      foreach ($polltype as $poll)
      {   
          if($poll-&gt;isActive==1 &amp;&amp; $poll-&gt;isPublished==0)
          {
              echo "pollId is=".$poll-&gt;pollId;
              $Id=$poll-&gt;pollId;
              $option=Polloption::model()-&gt;findAllByAttributes(array("pollId"=&gt;$poll-&gt;pollId));
  
              foreach ($option as $option1)
              {
                  echo $option1-&gt;optionId."&lt;/br&gt;";
                  echo $option1-&gt;option;
                  $optionList[]=$option1-&gt;option;
              }
          } 
      }
      echo CJSON::encode(array("PollId"=&gt;$Id,"Question"=&gt;$poll-&gt;pollQuestion,"options"=&gt;$optionList));
  }
  </code></pre>
  
  <p>So i am sending <code>pollQuestion</code> and its option in <code>json</code> format. From above,I am getting output as-</p>
  
  <pre><code>{"PollId":"3","Question":"Which is the biggest district in india ","options":["sachin tendulakar","Yuwraj singh","Rohit sharma","Mahendrasing dhoni"]}
  </code></pre>
  
  <p>But i want json in format:</p>
  
  <pre><code>{"PollId":"3","Question":"Which is the biggest district in india ","options":["option":"sachin tendulakar","option":"Yuwraj singh","option":"Rohit sharma","option":"Mahendrasing dhoni"]}
  </code></pre>
  
  <p>So what I need to modify? please help me....</p>