cLinkPager for search results

I have a search function that returns a list of search results, I am using cLinkPager to control the page. But it doesn’t work as the way it should be, when I click on the second page it just return to the default control page. I konw it may need to pass the search parameters to the page link, but can’t find the method in cLinkPager to do it. Any helps would be appreciated. Thanks.

You can save the search params in globalState

Yii::app()->setGlobalState(‘searchParams’,$params)

and then use them in your controller’s search action

see this

maybe help you

http://www.yiiframework.com/forum/index.php?/topic/5376-pagination-refine-search-results/

Thanks guys! These help!

But now I have another problem:

I have the following code to search across different tables:

$criteria=new CDbCriteria;

criteria->condition = $condition;

$pages=new CPagination(tbl1::model()->with(‘records’,‘records.record_name’)->together()->count($criteria));

$pages->pageSize=self::PAGE_SIZE;

$pages->applyLimit($criteria);

$models=tbl1::model()->with(‘records’,‘records.record_name’)->together()->findAll($criteria);

but then the page size is not working, pageSize=10, page1 shows 8 results, page2 shows 1.

The page works fine if I get rid of together() but then it can’t find column in records.record_name, saying unknown column for the query…

even if I use alias:

with(array(‘records’,‘records.record_name’=>array(‘alias’=>‘record_name’),))

$condition.=‘record_name.name ilike …’