本文整理汇总了PHP中pagination::getPageOffset方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::getPageOffset方法的具体用法?PHP pagination::getPageOffset怎么用?PHP pagination::getPageOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::getPageOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getParentFolderPath
$pagination->setTotal(sizeof($fileList));
$pagination->setFirstText(PAGINATION_FIRST);
$pagination->setPreviousText(PAGINATION_PREVIOUS);
$pagination->setNextText(PAGINATION_NEXT);
$pagination->setLastText(PAGINATION_LAST);
$pagination->setLimit(!empty($_GET['limit']) ? (int) $_GET['limit'] : CONFIG_DEFAULT_PAGINATION_LIMIT);
echo $pagination->getPaginationHTML();
echo "<script type=\"text/javascript\">\n";
echo "parentFolder = {path:'" . getParentFolderPath($folderInfo['path']) . "'};\n";
echo 'currentFolder ={';
$count = 1;
foreach ($folderInfo as $k => $v) {
echo ($count++ == 1 ? '' : ',') . "'" . $k . "':'" . ($k == 'ctime' || $k == 'mtime' ? date(DATE_TIME_FORMAT, $v) : $v) . "'";
}
echo "};\n";
$fileList = array_slice($fileList, $pagination->getPageOffset(), $pagination->getLimit());
echo 'numRows = ' . sizeof($fileList) . ";\n";
echo "files = {\n";
$count = 1;
foreach ($fileList as $file) {
echo ($count > 1 ? "," : '') . $count++ . ":{";
$j = 1;
foreach ($file as $k => $v) {
if ($k == 'ctime' || $k == 'mtime') {
$v = @date(DATE_TIME_FORMAT, $v);
}
if ($k == 'size') {
$v = transformFileSize($v);
}
echo ($j++ > 1 ? "," : '') . "'" . $k . "':'" . $v . "'";
}