当前位置: 首页>>代码示例>>PHP>>正文


PHP Paging::setLinkFormat方法代码示例

本文整理汇总了PHP中Paging::setLinkFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP Paging::setLinkFormat方法的具体用法?PHP Paging::setLinkFormat怎么用?PHP Paging::setLinkFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paging的用法示例。


在下文中一共展示了Paging::setLinkFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: empty

<?php

$attributes['order'] = empty($attributes['order']) ? "code" : $attributes['order'];
$attributes['pagesize'] = empty($attributes['pagesize']) ? $oSettingsManager->getValue("AdminTableSize", 25, "INT", "Number of elements in tables of administrator backend") : (int) $attributes['pagesize'];
if (!isset($attributes['sort'])) {
    $attributes['sort'] = "ASC";
} else {
    if (!in_array($attributes['sort'], array("ASC", "DESC"))) {
        $attributes['sort'] = "ASC";
    }
}
$attributes['asort'] = $attributes['sort'] == "ASC" ? "DESC" : "ASC";
$attributes['page'] = empty($attributes['page']) ? 1 : (int) $attributes['page'];
$oPaging = new Paging($attributes['pagesize'], $oLanguageManager->getLanguagesCount(), $attributes['page']);
$oPaging->setLinkFormat($here . "&page=%d");
$arrPageSizes = array(10, 25, 50, 100, 200);
if ($arrLanguages = $oLanguageManager->getLanguages($attributes['order'], $attributes['sort'], $oPaging->getOffSet(), $oPaging->getPageSize())) {
    _assign("arrLanguages", $arrLanguages);
    _assign("arrPages", $oPaging->getPages());
    _assign("arrPageSizes", $arrPageSizes);
}
_display("admin/dspLanguages.tpl");
开发者ID:rodionbykov,项目名称:zCMS,代码行数:22,代码来源:dspLanguages.php

示例2: empty

<?php

$attributes['page_size'] = empty($attributes['page_size']) ? $oSettingsManager->getValue("GalleryPicutresOnPage", 12, "INT", "Number of pictures in gallery page") : intval($attributes['page_size']);
$attributes['page'] = empty($attributes['page']) ? 1 : intval($attributes['page']);
if (!empty($attributes['gallery'])) {
    if ($ogGalleryManager->checkGallery($attributes['gallery'])) {
        $arrGalleries = $ogGalleryManager->getGalleries();
        $oPaging = new Paging($attributes['page_size'], $ogGalleryManager->getImagesCount($attributes['gallery']), $attributes['page']);
        $arrImages = $ogGalleryManager->getImages($attributes['gallery'], $oPaging->getOffSet(), $oPaging->getPageSize());
        $oPaging->setLinkFormat($attributes['gallery'] . '.gallery/' . "%d");
        $intAuthorID = $ogGalleryManager->getGalleryAuthorID($attributes['gallery']);
        $intEditorID = $ogGalleryManager->getGalleryEditorID($attributes['gallery']);
        $oAuthor = false;
        $oEditor = false;
        if ($intAuthorID) {
            $oAuthor = $oUserManager->getUserByID($intAuthorID);
        }
        if ($intEditorID) {
            $oEditor = $oUserManager->getUserByID($intEditorID);
        }
        if ($oAuthor) {
            _assign('oAuthor', $oAuthor);
        }
        if ($oEditor) {
            _assign('oEditor', $oEditor);
        }
        _assign("arrPages", $oPaging->getPages());
        _assign("arrGalleries", $arrGalleries);
        _assign("arrImages", $arrImages);
        _display("home/dspGallery.tpl");
    } else {
开发者ID:rodionbykov,项目名称:zCMS,代码行数:31,代码来源:dspGallery.php


注:本文中的Paging::setLinkFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。