本文整理汇总了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();
}
示例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 */
示例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 */
示例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
示例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 */