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


PHP Paginate::getNext方法代碼示例

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


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

示例1: index

 public function index()
 {
     //$this->test();
     $user_rec = new Usr_Schm();
     $user_rec->username = $_POST['username'] ? $_POST['username'] : "";
     $user_rec->password = $_POST['password'] ? $_POST['password'] : "";
     $user_rec->alias = $_POST['alias'] ? $_POST['alias'] : "";
     $user_rec->email = $_POST['email'] ? $_POST['email'] : "";
     $usernfo_rec = new Usrnfo_Schm();
     $usernfo_rec->im = $_POST['im'] ? $_POST['im'] : "";
     $usernfo_rec->name = $_POST['name'] ? $_POST['name'] : "";
     $usernfo_rec->url = $_POST['url'] ? $_POST['url'] : "";
     if (strlen($_POST['add'])) {
         $this->add($user_rec);
     }
     if (strlen($_POST['edit'])) {
         $this->edit($_POST['uid'], $user_rec, $usernfo_rec);
     }
     if (Util::isal_num($this->get['delete']) && $this->get['delete'] !== "") {
         $this->delete($this->get['delete']);
         $msg[] = "Record has been deleted with id: {$this->get['delete']}";
     }
     if (isset($this->get['page'])) {
         $offset = ($this->get['page'] - 1) * DISPLAY_NUM;
         if ($this->get['page'] <= 0) {
             $offset = 0;
         }
     } else {
         $offset = 0;
     }
     $records = "";
     foreach ($this->getRecords(DISPLAY_NUM, $offset) as $row) {
         $records .= "<tr>" . "<td>{$row['uid']}</td>" . "<td>{$row['username']}</td>" . "<td>{$row['alias']}</td>" . "<td>{$row['email']}</td>" . "<td>{$row['im']}</td>" . "<td>{$row['name']}</td>" . "<td>{$row['url']}</td>" . "<td><a href=\"/Users/edit/{$row['uid']}\">edit</a></td>" . "<td><a href=\"/Users/delete/{$row['uid']}\">delete</a></td>" . "</tr>\n";
     }
     $rec = null;
     if (Util::isal_num($this->get['edit'])) {
         $rec = $this->getRecord($this->get['edit']);
     }
     $output['content'] = $records;
     $paginate = new Paginate();
     $paginate->filename("/Users")->bond_id("page")->total($this->getRecordCount())->page_num($this->get['page'] - 1)->total_devisor(DISPLAY_NUM)->query_arg_array($this->get)->build();
     $output['paginate'] = array('next' => $paginate->getNext(), 'prev' => $paginate->getPrev(), 'pages' => $paginate->getPages());
     if ($this->get['submit'] == "true") {
         echo "<pre>Submitting\n" . $this->outputText() . "</pre>";
         exit;
     }
     $controller = Util::tpl_content('public/controller', 'users_tpl.php', array('get' => $this->get, 'output' => $output, 'rec' => $rec, 'msg' => $msg));
     $index = Util::tpl_content('public/body', 'index_tpl.php', array('get' => $this->get, 'title' => "Users"));
     echo Util::tpl_body($controller, $index);
     if (SYSDEBUG) {
         echo $this->outputLogHTML();
     }
 }
開發者ID:robertkraig,項目名稱:simplecms,代碼行數:53,代碼來源:class.controllers.Control_Users.php


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