Yii Framework Forum: CPagination params - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CPagination params Rate Topic: -----

#1 User is offline   lgoss007 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 01-October 09

Posted 23 October 2009 - 10:00 AM

[Solved] - no need to read.. carry on.

OK I'm probably missing something really simple... but when I try the following:

$pages=new CPagination($count);
$pages->pageSize=Yii::app()->params['recordsPerPage'];
$pages->applyLimit($criteria);
$pages->params(array(
	'startDate'=>$search->dateFrom,
	'endDate'=>$search->dateTo,
	'searchType'=>$search->searchType,
));


I get the following error:

Quote

CPagination does not have a method named "params".

C:\xampp\htdocs\yii-1.1\framework\base\CComponent.php(237)
...


I looked up the class CPagination and the documentation and I see a "public $params;" variable.. so I'm not sure why I'm getting this error. Anyone know?
0

#2 User is offline   lgoss007 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 01-October 09

Posted 23 October 2009 - 10:02 AM

OK I caught it.. missed an equals sign.. doh!
0

#3 User is online   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 23 October 2009 - 10:04 AM

CPagination::params is a property, not a method.

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users