<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 分頁 在開發Web應用程序時,您經常會遇到在頁面上打印出有限數量的記錄的要求。 然而,分頁背后的數學可能是棘手的,這就是為什么你應該使用Nette \ Utils \ Paginator。 我們實例化分頁器并設置對象的屬性,例如:每頁的記錄數,當前頁的數量和記錄的總數(如果已知)。 ~~~ $paginator = new Nette\Utils\Paginator; $paginator->setItemCount(356); // the total number of records (e.g., a number of products) $paginator->setItemsPerPage(30); // the number of records on page $paginator->setPage(1); // the number of the current page (numbered from one) ~~~ 對象可以傳遞給模板,之后我們可以提出明確的問題 ~~~ if ($paginator->first) ... // is this the first page? if ($paginator->last) ... // is this the last page? echo $paginator->page; // current page number ~~~ 我們在SQL查詢的配方中使用分頁器。 方法getLength()和getOffset()返回在LIMIT和OFFSET子句中使用的值。 ~~~ $result = $database->table('products') ->limit($paginator->getLength(), $paginator->getOffset()); ~~~ 如果您需要以相反順序的頁面(即,頁面號1對應于最高偏移量),則可以將getOffset()方法替換為getCountdownOffset()。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看