I’m quoting from the Blog tutorial: http://www.yiiframework.com/doc/blog/post.admin
public function actionAdmin()
{
$criteria=new CDbCriteria;
$pages=new CPagination(Post::model()->count());
$pages->applyLimit($criteria);
...
}
What I see happening here is that the CPagination object is used to set a variable in the CDbCriteria (limit).
Is it just me or does this seem very backward? Wouldn’t it be more natural to have a function in CDbCriteria that has limit as argument, ie. $criteria->setLimit(Post::model()->count()) ?
Thanks for any feedback, trying to grasp the logic here