當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Paging::create方法代碼示例

本文整理匯總了PHP中Paging::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Paging::create方法的具體用法?PHP Paging::create怎麽用?PHP Paging::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Paging的用法示例。


在下文中一共展示了Paging::create方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __constructor

 /**
  * 構造查詢對象
  * @param null $paging
  */
 function __constructor($paging = null)
 {
     $this->isPaging = isset($paging);
     $this->paging = isset($paging) ? $paging : Paging::create();
     $this->parameters = array();
     $this->operators = array();
 }
開發者ID:xlwmin,項目名稱:confusion,代碼行數:11,代碼來源:Query.php

示例2: array

            $where .= "AND `date` >= '{$_GET['from']}' ";
            $qpage .= "&from={$_GET['from']}";
        }
        if (isset($_GET['to']) && $_GET['to'] != '') {
            $where .= "AND `date` <= '{$_GET['to']}' ";
            $qpage .= "&to={$_GET['to']}";
        }
        if (isset($_GET['status']) && $_GET['status'] != '') {
            $status = Typo::int($_GET['status']);
            $where .= "AND `status` LIKE '%%{$status}%%' ";
            $qpage .= "&status={$status}";
        }
        $max = "15";
        if (isset($_GET['paging'])) {
            $paging = Typo::int($_GET['paging']);
            $offset = ($paging - 1) * $max;
        } else {
            $paging = 1;
            $offset = 0;
        }
        $data['posts'] = Db::result("SELECT * FROM `posts` \n            WHERE `type` = 'page' {$where} \n            ORDER BY `date` DESC \n            LIMIT {$offset},{$max}");
        $data['num'] = Db::$num_rows;
        Theme::admin('header', $data);
        System::inc('pages', $data);
        Theme::admin('footer');
        $page = array('paging' => $paging, 'table' => 'posts', 'where' => "`type` = 'page'" . $where, 'max' => $max, 'url' => 'index.php?page=pages' . $qpage, 'type' => 'pager');
        echo Paging::create($page);
        break;
}
/* End of file pages.control.php */
/* Location: ./inc/lib/Control/Backend/pages.control.php */
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:pages.control.php

示例3: array

* @copyright 2014-2015 Puguh Wijayanto
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/
$post = "";
$data['max'] = Options::get('post_perpage');
if (isset($_GET['paging'])) {
    $paging = Typo::int($_GET['paging']);
    if ($paging > 0) {
        $offset = ($paging - 1) * $data['max'];
    } else {
        $offset = 0;
    }
    $pagingtitle = " - Page {$paging}";
} else {
    $offset = 0;
    $paging = 1;
    $pagingtitle = "";
}
//echo $paging;
$data['sitetitle'] = Site::$slogan . $pagingtitle;
$data['posts'] = Db::result(sprintf("SELECT * FROM `posts` \n                            WHERE `type` = 'post' \n                            AND `status` = '1'\n                            ORDER BY `date` \n                            DESC LIMIT %d, %d", $offset, $data['max']));
$data['num'] = Db::$num_rows;
$url = SMART_URL ? Site::$url : Site::$url . '/index.php?';
$paging = array('paging' => $paging, 'table' => 'posts', 'where' => '`type` = \'post\'', 'max' => $data['max'], 'url' => $url, 'type' => Options::get('pagination'));
$data['paging'] = Paging::create($paging, SMART_URL);
Theme::theme('header', $data);
Theme::theme('index', $data);
Theme::footer();
/* End of file default.control.php */
/* Location: ./inc/lib/Control/Frontend/default.control.php */
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:default.control.php

示例4: Query

?>

<?php 
#頁眉
//////////////////////////////////////////////////////////////////////////////////////////////
include_once "include/header.php";
?>

<table>
    <tbody>
<?php 
include_once "framework/Database.php";
include_once "framework/Paging.php";
include_once "framework/Query.php";
include_once "framework/Service/CstKlassService.php";
$paging = Paging::create(1);
$query = new Query($paging);
echo CstKlassService::count($query);
$results = CstKlassService::results($query);
foreach ($results as $item) {
    ?>
        <tr>
            <td><?php 
    echo $item->getId();
    ?>
</td>
            <td><?php 
    echo $item->getTble();
    ?>
</td>
            <td><?php 
開發者ID:xlwmin,項目名稱:confusion,代碼行數:31,代碼來源:index.php

示例5: array

        if (isset($_GET['from']) && $_GET['from'] != '') {
            $where .= "AND `join_date` >= '{$_GET['from']}' ";
            $qpage .= "&from={$_GET['from']}";
        }
        if (isset($_GET['to']) && $_GET['to'] != '') {
            $where .= "AND `join_date` <= '{$_GET['to']}' ";
            $qpage .= "&to={$_GET['to']}";
        }
        if (isset($_GET['status']) && $_GET['status'] != '') {
            $where .= "AND `status` LIKE '%%{$_GET['status']}%%' ";
            $qpage .= "&status={$_GET['status']}";
        }
        $max = "10";
        if (isset($_GET['paging'])) {
            $paging = Typo::int($_GET['paging']);
            $offset = ($paging - 1) * $max;
        } else {
            $paging = 1;
            $offset = 0;
        }
        $data['usr'] = Db::result("SELECT * FROM `user` WHERE {$where} ORDER BY `userid` ASC LIMIT {$offset}, {$max}");
        $data['num'] = Db::$num_rows;
        $page = array('paging' => $paging, 'table' => 'user', 'where' => $where, 'max' => $max, 'url' => 'index.php?page=users' . $qpage, 'type' => 'pager');
        $data['paging'] = Paging::create($page);
        Theme::admin('header', $data);
        System::inc('user', $data);
        Theme::admin('footer');
        break;
}
/* End of file users.control.php */
/* Location: ./inc/lib/Control/Backend/users.control.php */
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:users.control.php


注:本文中的Paging::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。