title: Create pagination in yii framework
body: <p>I want to create pagination on my page without grid-view or model.
  This is my controller code:-</p>
  
  <pre><code>        $providers = Yii::app()-&gt;db-&gt;createCommand($query)-&gt;queryAll();
          $count = Yii::app()-&gt;db-&gt;createCommand($query)-&gt;queryAll();
  
          $dataProvider = new CSqlDataProvider($query, array(
             'totalItemCount' =&gt; $count,
             'pagination' =&gt; array(
                 'pageSize' =&gt; 10,
             ),
          ));
  </code></pre>
  
  <p>and my view code is:-</p>
  
  <pre><code>        &lt;?php $this-&gt;widget('zii.widgets.grid.CGridView', array(
             'id'=&gt;'students-grid',
             'dataProvider'=&gt; $dataProvider, 
          )); ?&gt;
  </code></pre>
  
  <p>But when I run this its show error message </p>
  
  <pre><code>    "Array to string conversion"
  </code></pre>
  
  <p>and 2nd option which I had try that is :-</p>
  
  <pre><code>        $criteria = new CDbCriteria();
          $count = Yii::app()-&gt;db-&gt;createCommand($query)-&gt;queryAll();
          $pages = new CPagination($count);
  
          // results per page
          $pages-&gt;pageSize=10;
          $pages-&gt;applyLimit($criteria);
  
          //$models=Article::model()-&gt;findAll($criteria);
  </code></pre>
  
  <p>But I don't know how to use this code because i have no model in this time.On the place of model what I can use?</p>