Hasilkan pagination HTML untuk aksesibilitas.
Paket keamanan: https://github.com/rancoud/Security
komposer memerlukan rancoud/pagination
$currentPage = 1;$countElements = 10;$countElementPerPage = 5;$p = New Pagination();$html = $p->generateHtml($currentPage, $countElements, $countElementPerPage);echo $html;
Ini akan menghasilkan
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
Root mewakili <ul>
Item mewakili <li>
Tautan mewakili <a>
Parameter | Jenis | Nilai bawaan | Keterangan |
---|---|---|---|
konfigurasi | susunan | [] | Parameter untuk mengubah perilaku penomoran halaman |
generateHtml(currentPage: int, countElements: int, countElementPerPage: int): string
generateData(currentPage: int, countElements: int, countElementPerPage: int): array
countPages(countElements: int, countElementPerPage: int): int
findItemInPage(countElementPerPage: int, indexItem: int): int
url (string) (contoh)
show_all_links (bool: false) (contoh)
use_previous (bool: false) (contoh)
selalu_use_previous (bool: false) (contoh)
use_next (bool: false) (contoh)
selalu_use_next (bool: false) (contoh)
use_dots (bool: false) (contoh)
count_pages_pair_limit (int: 0) (contoh)
count_pages_pair_adjacent (int: 2) (contoh)
text_previous (string: Halaman sebelumnya) (contoh)
text_next (string: Halaman selanjutnya) (contoh)
text_dots (string: …) (contoh)
text_page (string: {{PAGE}}) (contoh)
aria_label_link (string: Buka halaman {{PAGE}}) (contoh)
aria_label_current_link (string: Halaman saat ini, halaman {{PAGE}}) (contoh)
aria_label_nav (string: Pagination) (contoh)
aria_label_previous (string: Halaman sebelumnya) (contoh)
aria_label_next (string: Halaman selanjutnya) (contoh)
ribuan_separator (string) (contoh)
root_tag (string: ul) (contoh)
root_attrs (string) (contoh)
use_nav (bool: true) (contoh)
nav_attrs (string) (contoh)
item_tag (string: li) (contoh)
item_attrs (string) (contoh)
item_attrs_current (string) (contoh)
item_previous_attrs (string) (contoh)
item_previous_attrs_disabled (string) (contoh)
item_next_attrs (string) (contoh)
item_next_attrs_disabled (string) (contoh)
item_dots_attrs (string) (contoh)
link_tag (string: a) (contoh)
link_attrs (string) (contoh)
link_attrs_current (string) (contoh)
link_previous_attrs_disabled (string) (contoh)
link_next_attrs_disabled (string) (contoh)
dot_tag (string: span) (contoh)
dot_attrs (string) (contoh)
use_pretty_html (bool: true) (contoh)
html_tab_sequence (string: t) (contoh)
html_initial_indentation (int: 0) (contoh)
esc_attr (bool: benar) (contoh)
esc_html (bool: benar) (contoh)
charset (string: UTF-8) (contoh)
Anda harus membersihkan sendiri parameter tersebut:
nav_attrs
root_attrs
item_attrs
item_attrs_saat ini
item_previous_attrs
item_previous_attrs_disabled
item_next_attrs
item_next_attrs_disabled
item_dots_attrs
tautan_attrs
link_attrs_current
link_previous_attrs_disabled
link_next_attrs_disabled
titik_attrs
html_tab_urutan
Halaman ditambahkan di akhir
$conf = ['url' => 'https://example.com/news/page/'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li><a href="https://contoh. com/berita/halaman/2" aria-label="Halaman 2">2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['url' => 'https://example.com/news/page/{{PAGE}}/?date=desc'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li><a href="https://contoh. com/berita/halaman/2/?tanggal=desc" aria-label="Halaman 2">2</a></li></ul></nav>
Setelah halaman ganti dengan pola {{PAGE}}
$conf = ['url' => '{{PAGE}}?date=desc'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="page">1</a></li><li><a href="2?tanggal=desc" aria-label= "Halaman 2">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Url
$conf = ['show_all_links' => true];echo (Pagination baru($conf))->generateHtml(1, 30, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="3" aria-label="Page 3">3</a></li><li><a href="4" aria-label="Page 4">4</a></li><li><a href="5" aria-label="Page 5">5</a></ li><li><a href="6" aria-label="Halaman 6">6</a></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
$conf = ['use_previous' => true];echo (Pagination baru($conf))->generateHtml(2, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Previous page">Halaman sebelumnya</a></li><li><a href="1" aria-label="Page 1">1</a></li><li><a href="#" aria-label="Halaman 2" aria-current="halaman">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
Sebelumnya memiliki aria-disabled=true
pada tag link jika tidak ada halaman sebelumnya
$conf = ['always_use_previous' => true];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman sebelumnya" aria-disabled="true">Halaman sebelumnya</a></li><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
$conf = ['use_next' => true];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="2" aria-label="Halaman berikutnya">Halaman selanjutnya</a></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
Berikutnya ada aria-disabled=true
pada tag tautan jika tidak ada halaman berikutnya
$conf = ['always_use_next' => true];echo (Pagination baru($conf))->generateHtml(2, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Page 1">1</a></li><li><a href ="#" aria-label="Halaman 2" aria-current="halaman">2</a></li><li><a href="#" aria-label="Halaman berikutnya" aria-disabled="true">Halaman berikutnya</a></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
$conf = ['use_dots' => true];echo (Paginasi baru($conf))->generateHtml(1, 30, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="3" aria-label="Page 3">3</a></li><li aria-hidden="true"> <span>…</span></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
$conf = ['count_pages_pair_limit' => 1];echo (Pagination baru($conf))->generateHtml(5, 300, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Page 1">1</a></li><li><a href ="3" aria-label="Page 3">3</a></li><li><a href="4" aria-label="Page 4">4</ a></li><li><a href="#" aria-label="Halaman 5" aria-current="halaman">5</a></li><li><a href="6" aria-label="Halaman 6"> 6</a></li><li><a href="7" aria-label="Page 7">7</a></li><li><a href="60" aria-label="Halaman 60">60</a></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
$conf = ['count_pages_pair_adjacent' => 1];echo (Pagination baru($conf))->generateHtml(5, 300, 5);
<nav aria-label="Pagination"><ul><li><a href="4" aria-label="Page 4">4</a></li><li><a href ="#" aria-label="Halaman 5" aria-current="halaman">5</a></li><li><a href="6" aria-label="Halaman 6"> 6</a></li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
count_pages_pair_limit 0 + count_pages_pair_adjacent 0
$conf = ['count_pages_pair_limit' => 0,'count_pages_pair_adjacent' => 0];echo (Pagination baru($conf))->generateHtml(5, 300, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 5" aria-current="halaman">5</a></li></ul></nav>
hitungan_halaman_pasangan_batas 2 + hitungan_halaman_pasangan_berdekatan 2
$conf = ['count_pages_pair_limit' => 2,'count_pages_pair_adjacent' => 2];echo (Pagination baru($conf))->generateHtml(5, 300, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Page 1">1</a></li><li><a href ="2" aria-label="Page 2">2</a></li><li><a href="3" aria-label="Page 3">3</ a></li><li><a href="4" aria-label="Halaman 4">4</a></li><li><a href="#" aria-label="Halaman 5" aria-current="halaman">5</a></li><li><a href="6" aria-label="Halaman 6"> 6</a></li><li><a href="7" aria-label="Page 7">7</a></li><li><a href="59" aria-label="Page 59">59</a></li><li><a href="60" aria-label="Page 60">60</a></ li></ul></nav>
⏫ Parameter Konfigurasi / Perilaku
$conf = ['use_previous' => true,'text_previous' => 'prev'];echo (Pagination baru($conf))->generateHtml(2, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Previous page">sebelumnya</a></li><li><a href ="1" aria-label="Halaman 1">1</a></li><li><a href="#" aria-label="Halaman 2" aria-current="halaman">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['use_next' => true,'text_next' => 'next'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="2" aria-label="Halaman berikutnya">berikutnya</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['use_dots' => true,'text_dots' => 'titik'];echo (Pagination baru($conf))->generateHtml(1, 30, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="3" aria-label="Page 3">3</a></li><li aria-hidden="true"> <span>titik</span></li></ul></nav>
⏫ Parameter Konfigurasi / Label
Halaman ditambahkan di akhir
$conf = ['text_page' => 'yolo'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">yolo 1</a></li><li><a href="2" aria-label="Halaman 2" >yolo 2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['text_page' => 'yo {{PAGE}} lo'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">yo 1 lo</a></li><li><a href="2" aria-label="Page 2 ">yo 2 lo</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['aria_label_link' => 'aria label link'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li><a href="2" aria-label="aria label  ;tautan">2</a></li></ul></nav>
Dengan pola {{PAGE}}
$conf = ['aria_label_link' => 'aria label link {{PAGE}}'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li><a href="2" aria-label="aria label  ;tautan 2">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['aria_label_current_link' => 'aria label tautan saat ini'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="aria label saat ini link" aria-current="page">1</a></li><li><a href="2" aria-label= "Halaman 2">2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['aria_label_current_link' => 'aria label tautan saat ini {{PAGE}}'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="aria label saat ini tautan 1" aria-saat ini="halaman">1</a></li><li><a href="2" aria-label="Halaman 2">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['aria_label_nav' => 'aria label nav'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="aria label nav"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['use_previous' => true,'aria_label_previous' => 'prev'];echo (Pagination baru($conf))->generateHtml(2, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="prev">Halaman sebelumnya</a></li><li><a href="1 " aria-label="Halaman 1">1</a></li><li><a href="#" aria-label="Halaman 2" aria-current="halaman">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['use_next' => true,'aria_label_next' => 'next'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="2" aria-label="next">Halaman selanjutnya</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['thousands_separator' => ';','count_pages_pair_limit' => 1];echo (Pagination baru($conf))->generateHtml(1, 1000, 1);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="3" aria-label="Page 3">3</a></li><li><a href="1000" aria-label="Halaman 1000">1;000</a></li></ul></nav>
⏫ Parameter Konfigurasi / Label
$conf = ['root_tag' => 'root'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><root><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></root></nav>
⏫ Parameter Konfigurasi / markup HTML / Root
$conf = ['root_attrs' => 'data-root="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul data-root="attrs"><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Root
$conf = ['use_nav' => false];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul>
⏫ Parameter Konfigurasi / markup HTML / Root
$conf = ['nav_attrs' => 'data-item="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination" data-item="attrs"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Root
$conf = ['item_tag' => 'item'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><item><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></item><item><a href="2" aria-label="Halaman 2"> 2</a></item></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['item_attrs' => 'data-item="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li data-item="attrs"><a href="2" aria-label=" Halaman 2">2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['item_attrs' => 'data-item="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li data-item="attrs 2"><a href="2" aria-label= "Halaman 2">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['item_attrs_current' => 'data-item-current="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li data-item-current="attrs"><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['item_attrs_current' => 'data-item-current="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li data-item-current="attrs 1"><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['use_previous' => true,'item_previous_attrs' => 'data-item-previous="attrs"'];echo (Pagination baru($conf))->generateHtml(2, 10, 5);
<nav aria-label="Pagination"><ul><li data-item-previous="attrs"><a href="1" aria-label="Previous page">Halaman sebelumnya</a> </li><li><a href="1" aria-label="Page 1">1</a></li><li><a href="#" aria-label="Halaman 2" aria-current="halaman">2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['use_previous' => true,'item_previous_attrs' => 'data-item-previous="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(2, 10 , 5);
<nav aria-label="Pagination"><ul><li data-item-previous="attrs 1"><a href="1" aria-label="Previous page">Halaman sebelumnya</a ></li><li><a href="1" aria-label="Halaman 1">1</a></li><li><a href="#" aria-label="Halaman 2" aria-current="halaman">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['always_use_previous' => true,'item_previous_attrs_disabled' => 'data-item-previous-disabled="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5) ;
<nav aria-label="Pagination"><ul><li data-item-previous-disabled="attrs"><a href="#" aria-label="Halaman sebelumnya" aria-disabled="true">Halaman sebelumnya</a></li><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['always_use_previous' => true,'item_previous_attrs_disabled' => 'data-item-previous-disabled="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(1 , 10, 5);
<nav aria-label="Pagination"><ul><li data-item-previous-disabled="attrs 0"><a href="#" aria-label="Halaman sebelumnya" aria-disabled="true">Halaman sebelumnya</a></li><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['use_next' => true,'item_next_attrs' => 'data-item-next="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li data-item-next="attrs"><a href="2" aria-label="Next page">Halaman berikutnya</a></li> </ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['use_next' => true,'item_next_attrs' => 'data-item-next="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(1, 10 , 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li data-item-next="attrs 2"><a href="2" aria-label="Next page">Halaman berikutnya</a></li ></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['always_use_next' => true,'item_next_attrs_disabled' => 'data-item-next-disabled="attrs"'];echo (Pagination baru($conf))->generateHtml(2, 10, 5) ;
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Page 1">1</a></li><li><a href ="#" aria-label="Page 2" aria-current="page">2</a></li><li data-item-next-disabled="attrs"><a href="# ;" aria-label="Halaman berikutnya" aria-disabled="true">Halaman berikutnya</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['always_use_next' => true,'item_next_attrs_disabled' => 'data-item-next-disabled="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(2 , 10, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Page 1">1</a></li><li><a href ="#" aria-label="Page 2" aria-current="page">2</a></li><li data-item-next-disabled="attrs 2"><a href="&# x23;" aria-label="Halaman berikutnya" aria-disabled="true">Halaman berikutnya</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['use_dots' => true,'item_dots_attrs' => 'data-item-dots="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 30, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="3" aria-label="Page 3">3</a></li><li data-item-dots="attrs " aria-hidden="benar"><span>…</span></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Item
$conf = ['link_tag' => 'link'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><link href="#" aria-label="Halaman 1" aria-current="halaman">1</link></li><li><link href="2" aria-label="Halaman 2"> 2</link></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Tautan
$conf = ['link_attrs' => 'data-link="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li><a data-link="attrs" href="2" aria-label=" Halaman 2">2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['link_attrs' => 'data-link="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li><a data-link="attrs 2" href="2" aria-label= "Halaman 2">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Tautan
$conf = ['link_attrs_current' => 'data-link-current="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a data-link-current="attrs" href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['link_attrs_current' => 'data-link-current="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a data-link-current="attrs 1" href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Tautan
$conf = ['always_use_previous' => true,'link_previous_attrs_disabled' => 'data-item-next-disabled="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 10, 5) ;
<nav aria-label="Pagination"><ul><li><a data-item-next-disabled="attrs" href="#" aria-label="Halaman sebelumnya" aria-disabled="true">Halaman sebelumnya</a></li><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['always_use_previous' => true,'link_previous_attrs_disabled' => 'data-item-next-disabled="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(1 , 10, 5);
<nav aria-label="Pagination"><ul><li><a data-item-next-disabled="attrs 0" href="#" aria-label="Halaman sebelumnya" aria-disabled="true">Halaman sebelumnya</a></li><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Tautan
$conf = ['always_use_next' => true,'link_next_attrs_disabled' => 'data-item-next-disabled="attrs"'];echo (Pagination baru($conf))->generateHtml(2, 10, 5) ;
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Page 1">1</a></li><li><a href ="#" aria-label="Page 2" aria-current="page">2</a></li><li><a data-item-next-disabled="attrs" href="# ;" aria-label="Halaman berikutnya" aria-disabled="true">Halaman berikutnya</a></li></ul></nav>
Ganti halaman dengan pola {{PAGE}}
$conf = ['always_use_next' => true,'link_next_attrs_disabled' => 'data-item-next-disabled="attrs {{PAGE}}"'];echo (Pagination baru($conf))->generateHtml(2 , 10, 5);
<nav aria-label="Pagination"><ul><li><a href="1" aria-label="Page 1">1</a></li><li><a href ="#" aria-label="Page 2" aria-current="page">2</a></li><li><a data-item-next-disabled="attrs 2" href="&# x23;" aria-label="Halaman berikutnya" aria-disabled="true">Halaman berikutnya</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Tautan
$conf = ['use_dots' => true,'dot_tag' => 'p'];echo (Pagination baru($conf))->generateHtml(1, 30, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="3" aria-label="Page 3">3</a></li><li aria-hidden="true"> <p>…</p></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Tautan
$conf = ['use_dots' => true,'dot_attrs' => 'data-dot="attrs"'];echo (Pagination baru($conf))->generateHtml(1, 30, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li><li><a href="3" aria-label="Page 3">3</a></li><li aria-hidden="true"> <rentang data-dot="attrs">…</span></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Tautan
$conf = ['use_pretty_html' => false];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Indentasi
$conf = ['html_tab_sequence' => ''];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Indentasi
$conf = ['html_initial_indentation' => 1];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Indentasi
$conf = ['esc_attr' => false];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Page 1" aria-current="page">1</a></li><li ><a href="2" aria-label="Halaman 2">2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Keamanan
$conf = ['esc_html' => false,'text_page' => '<em>{{PAGE}}</em>'];echo (Pagination baru($conf))->generateHtml(1, 10, 5 );
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="page"><em>1</em></a></li><li><a href="2" aria-label=" Halaman 2"><em>2</em></a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Keamanan
$conf = ['charset' => 'EUC-JP'];echo (Pagination baru($conf))->generateHtml(1, 10, 5);
<nav aria-label="Pagination"><ul><li><a href="#" aria-label="Halaman 1" aria-current="halaman">1</a></li><li><a href="2" aria-label="Halaman 2"> 2</a></li></ul></nav>
⏫ Parameter Konfigurasi / markup HTML / Keamanan
$conf = ['always_use_previous' => benar,'always_use_next' => benar,'use_dots' => benar, ]var_dump(Pagination baru($conf))->generateData(1, 3000, 5);array (ukuran=3) 'sebelumnya' => objek(RancoudPaginationItem)[2] public 'ariaLabel' => string 'Halaman Sebelumnya' (panjang=18) publik 'href' => string '#' (panjang=6) publik 'itemAttrs' => string '' (panjang=0) publik 'linkAttrs' => string '' (panjang=0) public 'teks' => string 'Halaman sebelumnya' (panjang=13) publik 'isCurrent' => boolean salah publik 'isDots' => boolean salah public 'isDisabled' => boolean benar publik 'halaman' => int 0 'tautan' => larik (ukuran=4) 0 => objek(RancoudPaginationItem)[4] public 'ariaLabel' => string 'Halaman 1' (panjang=11) public 'href' => string '#' (panjang=6) publik 'itemAttrs' => string '' (panjang=0) publik 'linkAttrs' => string '' (panjang=0) publik 'teks' => string '1' (panjang=1) publik 'isCurrent' => boolean benar publik 'isDots' => boolean salah publik 'isDisabled' => boolean salah 'halaman' publik => int 1 1 => objek(RancoudPaginationItem)[5] public 'ariaLabel' => string 'Halaman 2' (panjang=11) public 'href' => string '2' (panjang=1) publik 'itemAttrs' => string '' (panjang=0) publik 'linkAttrs' => string '' (panjang=0) publik 'teks' => string '2' (panjang=1) publik 'isCurrent' => boolean salah publik 'isDots' => boolean salah publik 'isDisabled' => boolean salah 'halaman' publik => int 2 2 => objek(RancoudPaginationItem)[6] public 'ariaLabel' => string 'Halaman 3' (panjang=11) public 'href' => string '3' (panjang=1) publik 'itemAttrs' => string '' (panjang=0) publik 'linkAttrs' => string '' (panjang=0) publik 'teks' => string '3' (panjang=1) publik 'isCurrent' => boolean salah publik 'isDots' => boolean salah publik 'isDisabled' => boolean salah 'halaman' publik => int 3 3 => objek(RancoudPaginationItem)[7] public 'ariaLabel' => string 'Halaman 4' (panjang=11) public 'href' => string '4' (panjang=1) publik 'itemAttrs' => string '' (panjang=0) publik 'linkAttrs' => string '' (panjang=0) publik 'teks' => string '…' (panjang=3) publik 'isCurrent' => boolean salah publik 'isDots' => boolean benar publik 'isDisabled' => boolean salah 'halaman' publik => int 4 'berikutnya' => objek(RancoudPaginationItem)[8] public 'ariaLabel' => string 'Halaman berikutnya' (panjang=14) public 'href' => string '2' (panjang=1) publik 'itemAttrs' => string '' (panjang=0) publik 'linkAttrs' => string '' (panjang=0) public 'teks' => string 'Halaman berikutnya' (panjang=9) publik 'isCurrent' => boolean salah publik 'isDots' => boolean salah publik 'isDisabled' => boolean salah publik 'halaman' => int 2
composer ci
untuk php-cs-fixer dan phpunit dan cakupan
composer lint
untuk php-cs-fixer
composer test
untuk phpunit dan cakupan