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


PHP Paginator::set_parameters方法代码示例

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


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

示例1: get_data

 public function get_data()
 {
     $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
     if (!empty($this->data["tableName"])) {
         $query = "SHOW TABLES FROM " . DB_NAME;
         $result = $mysqli->query($query);
         while ($row = $result->fetch_row()) {
             if (empty($this->tableName)) {
                 if ($row[0] == $this->data["tableName"]) {
                     $this->tableName = $row[0];
                 }
             }
         }
         $result->free();
         if (empty($this->tableName)) {
             $this->tableName = TABLENAME;
         }
     }
     if (!empty($this->data["selectors"]) or !empty($this->data["sorter"])) {
         $query = "SHOW COLUMNS FROM " . $this->tableName;
         $result = $mysqli->query($query);
         while ($row = $result->fetch_assoc()) {
             if (!empty($this->data['selectors'])) {
                 foreach ($this->data["selectors"] as $key->{$value}) {
                     if (empty($this->selectors[$key])) {
                         if ($row["Field"] == $key) {
                             $this->selectors[$key] = $value;
                         }
                     }
                 }
             }
             if (empty($this->sorter)) {
                 if ($row["Field"] == $this->data["sorter"]) {
                     $this->sorter = $row["Field"];
                 }
             }
         }
         $result->free();
         if (empty($this->sorter)) {
             $this->sorter = SORTER;
         }
     }
     $mysqli->close();
     $this->currentPage = is_numeric($this->data["currentPage"]) && $this->data["currentPage"] >= 1 ? $this->data["currentPage"] : CURRENTPAGE;
     $this->pcsPerPage = is_numeric($this->data["pcsPerPage"]) && $this->data["pcsPerPage"] >= 1 ? $this->data["pcsPerPage"] : PCSPERPAGE;
     $this->shownPages = is_numeric($this->data["shownPages"]) && $this->data["shownPages"] >= 1 ? $this->data["shownPages"] : SHOWNPAGES;
     $this->ascending = is_bool($this->data["ascending"]) ? $this->data["ascending"] : ASCENDING;
     $pager = new Paginator();
     echo "1" . !$this->data["ascending"];
     // echo($this->tableName.$this->currentPage.$this->sorter."'".$this->ascending."'".$this->pcsPerPage.$this->shownPages);
     $result = $pager->set_parameters($this->tableName, $this->currentPage, $this->sorter, $this->ascending, $this->pcsPerPage, $this->shownPages, $this->selectors);
     return $result;
 }
开发者ID:kitlum,项目名称:pager,代码行数:53,代码来源:conditioner.class.php

示例2: Paginator

<?php

include "pager.php";
$a = new Paginator();
$b = $a->set_parameters();
$c = $b['pager'];
$d = $b['content'];
for ($i = 0; $i < count($c); $i++) {
    echo $c[$i] . "|";
}
开发者ID:kitlum,项目名称:pager,代码行数:10,代码来源:index.php


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