本文整理汇总了PHP中page::page方法的典型用法代码示例。如果您正苦于以下问题:PHP page::page方法的具体用法?PHP page::page怎么用?PHP page::page使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page
的用法示例。
在下文中一共展示了page::page方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* 初始化参数
* @param $page 当前页码
* @param $size 页面大小
* @param $count 总记录条数
* @param $set 设置当前页的左右边有多少个链接(默认5个)
*/
public static function init($page, $size, $count, $set = 5)
{
self::$page = $page;
self::$size = $size;
self::$count = $count;
self::$query = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$i = strrpos(self::$query, 'page');
if ($i) {
self::$query = substr(self::$query, 0, $i);
}
$parse_url = parse_url(self::$query);
$parse_url['query'] = preg_replace('/[\\?]*&*/', '', $parse_url['query']);
if (!strlen($parse_url['query']) && self::$rewrite === false) {
self::$is_frist = true;
self::$query = $parse_url['scheme'] . '://' . $parse_url['host'] . $parse_url['path'] . '?';
}
$i = strrpos(self::$query, '/');
if ($i != strlen(self::$query) - 1) {
self::$query .= '/';
}
self::$set = $set;
self::$total = ceil(self::$count / self::$size);
if (self::$rewrite === true) {
self::$op = '/';
} else {
self::$op = '=';
self::$query = substr(self::$query, 0, -1);
if (strrpos(self::$query, '&') === false) {
if (self::$is_frist === false) {
self::$query .= '&';
}
}
}
}
示例2: random
/**
* Constructor
*/
function random(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
global $_GET;
// limit
$limit = $_GET['limit'];
if (is_numeric($limit)) {
$limit = intval($limit);
if ($limit > 0) {
$this->limit = $limit;
if ($limit > $this->max) {
$this->limit = $this->max;
}
}
}
// min length
$min_length = $_GET['min_length'];
if (is_numeric($min_length)) {
$min_length = intval($min_length);
if ($min_length > 0) {
$this->min_length = $min_length;
}
}
// max length
$max_length = $_GET['max_length'];
if (is_numeric($max_length)) {
$max_length = intval($max_length);
if ($max_length > 0) {
$this->max_length = $max_length;
}
}
// sanity check: if min_length > max_length, then make them equal
if ($this->min_length && $this->max_length) {
if ($this->min_length > $this->max_length) {
$this->min_length = $this->max_length;
}
}
}
示例3: home
/**
* Constructor
*/
function home(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
}
示例4: proverb
/**
* Constructor
*/
function proverb(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
$this->db->defaults['rperpage'] = 20;
}
示例5: dictionary
/**
* Constructor
*/
function dictionary(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
$this->abbrevs = $this->db->get_row_assoc('SELECT * FROM sys_abbrev', 'abbrev', 'label');
$this->abbrevs['var'] = 'Variasi ejaan';
}
示例6: doc
/**
* Constructor
*/
function doc(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
}
示例7: comment
/**
* Constructor
*/
function comment(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
}
示例8: user
/**
* Constructor
*/
function user(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
$this->status = PROCESS_NONE;
}
示例9: glossary
/**
* Constructor
*/
function glossary(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
}
示例10: abbr
/**
* Constructor
*/
function abbr(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
}
示例11: dictionary
/**
* Constructor
*/
function dictionary(&$db, &$auth, $msg)
{
parent::page(&$db, &$auth, $msg);
}