How to specify page size in dynamically in yii view? <p>How to specify <strong>page size</strong> in dynamically in yii view?(not a grid view) In my custom view page there is a search option to find list of users between 2 date i need 2 know how to specify the page size dynamically? If number of rows less than 10 how to hide <a href="http://www.yiiframework.com/doc/api/1.1/CPagination" rel="nofollow noreferrer">pagination</a> ?<img src="https://i.stack.imgur.com/ONpvi.png" alt="enter image description here"> </p> <p>please check screen-shoot </p> <p><strong>I dont want the page navigation after search it confusing users..</strong></p> <p>my controller code <br></p> <pre><code> $criteria=new CDbCriteria(); $count=CustomerPayments::model()-&gt;count($criteria); $pages=new CPagination($count); // results per page $pages-&gt;pageSize=10; $pages-&gt;applyLimit($criteria); $paymnt_details=CustomerPayments::model()-&gt;findAll($criteria); $this-&gt;render('renewal',array('paymnt_details'=&gt;$paymnt_details,'report'=&gt;$report,'branch'=&gt;$branch,'model'=&gt;$model,'pages' =&gt; $pages,)); } </code></pre> <p>my view <a href="http://pastebin.com/mpR3uWA3" rel="nofollow noreferrer">Link</a></p>