CakePHP pagination + rangeable problem
I am using the rangeable behavior: https://gith开发者_StackOverflow中文版ub.com/zeroasterisk/cakephp-behavior-rangeable
To create a paginated set of results ordered by range. I model my code after the very last example in that link. In my controller I have:
function myaction($lat, $lon) {
$myContain = array('Model1', 'Model2');
$this->paginate = array('type' => 'range', 'recursive' => 3, 'contain' => $myContain,
'fields' => array('name', 'lat', 'lon'),
'conditions' => array('Place.x_count >' => 0),
'limit' => 3,
'lat' => $lat,
'lon' => $lon,
'range' => 100, // look for all jobs within 10 miles, default = 20
'range_out_till_count_is' => 10,
);
$places = $this->paginate('Place');
$this->set('places', $places);
}
So the problem I am having is that this works fine when I call my controller/action/lat/lon/page:1
I even see it has the correct count, how many pages of results there are, etc. So far so good. But when I click on the next link and it takes me to controller/action/lat/lon/page:2
The results are totally blank. I did a lot of printing out of stuff and it all looks fine, it seems to be the paginate call that fails somehow. Anyone have an idea?
精彩评论