How to Override createPageUrl() method to add own parameter list?

Hi All,

I am using CLinkPager and CPagination classes for pagination.

I am providing input fields to user, on the basis of them user can filter the result list.

My searching is working fine but when i used pagination links to go on next page i am not getting the searching results. I know that pagination links are not getting my searching parameters, for that i have to Override createPageUrl() method of CPagination class but i am not able to do it.

Any one can tell me how to Override this method and what should be the code for that method?

Please help me on this issue.

Thanks!!!

<?php

Yii::import(‘system.web.CPagination’);

class PaginationEx extends CPagination

{

public function createPageUrl(&#036;controller,&#036;page)


{


   // parent::createPageUrl(&#036;controller,&#036;page);


    


    &#036;params=&#036;this-&gt;params===null ? &#036;_GET : &#036;this-&gt;params;


    


    if(&#036;page&gt;0) // page 0 is the default


        &#036;params[&#036;this-&gt;pageVar]=&#036;page+1;


    else


        unset(&#036;params[&#036;this-&gt;pageVar]);


   


    if( isset( &#036;_POST['dt1'] ) &amp;&amp; &#33;empty( &#036;_POST['dt1']))


       &#036;params['dt1']= &#036;_POST['dt1'];


        


    if( isset( &#036;_POST['dt2'] ) &amp;&amp; &#33;empty( &#036;_POST['dt2']))


       &#036;params['dt2']= &#036;_POST['dt2'];    


    


   return &#036;controller-&gt;createUrl(&#036;this-&gt;route,&#036;params);


    //return 1;


    


}

}

?>

but you could use Yii:app()->session to store CDbCriteria from model and use it in controller before call search

[color="#006400"]NOTE: moved to proper section (General Discussion for Yii 1.1.x instead of Tips, Snippets and Tutorials)[/color]