本文整理汇总了PHP中Paginator::parseExtended方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::parseExtended方法的具体用法?PHP Paginator::parseExtended怎么用?PHP Paginator::parseExtended使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::parseExtended方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lRange
public static function lRange($key, $start = 0, $end = -1)
{
$value = R::factory()->lrange($key, $start, $end);
$data = array('key' => $key, 'start' => $start, 'end' => $end, 'value' => $value, 'paginator' => '');
$total = R::factory()->lLen($key);
$data['command'] = 'LRANGE ' . $key . ' ' . $start . ' ' . $end;
$re = Config::get('re_prefix') . 'log:';
$data['history'] = substr($key, 0, strlen($re)) == $re;
if ($total > Config::get('re_limit')) {
$dataUrl = array('db' => Request::factory()->getDb(), 'cmd' => 'LRANGE ' . $key);
$url = '/?' . http_build_query($dataUrl) . '+:start:+:end:+&page=:page:';
$data['paginator'] = Paginator::parseExtended($total, Request::factory()->getPage(), $url, Config::get('re_pages'));
}
return View::factory('tables/lrange', $data);
}
示例2: zRangeByScore
public static function zRangeByScore($key, $min = '-inf', $max = '+inf', $limit, $offset)
{
$total = R::factory()->zCard($key);
$value = R::factory()->zRangeByScore($key, $min, $max, array('withscores' => true, 'limit' => array($offset, $limit)));
$data = array('key' => $key, 'start' => $offset, 'end' => Config::get('re_limit'), 'value' => $value);
$data['paginator'] = '';
$data['command'] = 'ZRANGEBYSCORE ' . $key . ' ' . $min . ' ' . $max;
if ($total > Config::get('re_limit')) {
$dataUrl = array('db' => Request::factory()->getDb(), 'cmd' => 'ZRANGEBYSCORE ' . $key . ' ' . $min . ' ' . $max);
if ($limit) {
$dataUrl['cmd'] .= ' LIMIT';
$data['command'] .= ' LIMIT ' . $offset . ' ' . $limit;
}
$url = '/?' . http_build_query($dataUrl) . '+:start:+' . Config::get('re_limit') . '+&page=:page:';
$data['paginator'] = Paginator::parseExtended($total, Request::factory()->getPage(), $url, Config::get('re_pages'));
}
return View::factory('tables/zrange', $data);
}