PHPackages                             muhammetsafak/php-pagination - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. muhammetsafak/php-pagination

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

muhammetsafak/php-pagination
============================

PHP Pagination Class

0.1(4y ago)03MITPHPPHP &gt;=7.4

Since Apr 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/muhammetsafak/Pagination)[ Packagist](https://packagist.org/packages/muhammetsafak/php-pagination)[ RSS](/packages/muhammetsafak-php-pagination/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Pagination
==========

[](#pagination)

PHP Sayfalama Sınıfı

[![Latest Stable Version](https://camo.githubusercontent.com/5684aa640cae892217f54305af1fd043234615d8e32d4fe23199514c073af327/687474703a2f2f706f7365722e707567782e6f72672f6d7568616d6d6574736166616b2f7068702d706167696e6174696f6e2f76)](https://packagist.org/packages/muhammetsafak/php-pagination) [![Total Downloads](https://camo.githubusercontent.com/d266b2e4ea1b112ba111ad830d2145b6d346076ea63a0b6693ca4b92bc39f6c5/687474703a2f2f706f7365722e707567782e6f72672f6d7568616d6d6574736166616b2f7068702d706167696e6174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/muhammetsafak/php-pagination) [![Latest Unstable Version](https://camo.githubusercontent.com/43dea261789deb536c19e3fbbde60e4530ab59543bb289d36d4dacc05f943249/687474703a2f2f706f7365722e707567782e6f72672f6d7568616d6d6574736166616b2f7068702d706167696e6174696f6e2f762f756e737461626c65)](https://packagist.org/packages/muhammetsafak/php-pagination) [![License](https://camo.githubusercontent.com/64a0b770377537a7a1fe21817c00ef54285d8531b1f42e5e6a2280352acfefc8/687474703a2f2f706f7365722e707567782e6f72672f6d7568616d6d6574736166616b2f7068702d706167696e6174696f6e2f6c6963656e7365)](https://packagist.org/packages/muhammetsafak/php-pagination) [![PHP Version Require](https://camo.githubusercontent.com/010b56c20c084d84df81ce1b2d24f9560b5e6c6ec7ba66cb568c2623d88e3d83/687474703a2f2f706f7365722e707567782e6f72672f6d7568616d6d6574736166616b2f7068702d706167696e6174696f6e2f726571756972652f706870)](https://packagist.org/packages/muhammetsafak/php-pagination)

Kurulum
-------

[](#kurulum)

```
composer require muhammetsafak/php-pagination

```

Yöntemler
---------

[](#yöntemler)

### `__construct()`

[](#__construct)

Sınıfın kurucu metodudur.

```
public function __construct(int $page, int $totalRow, int $perPageLimit = 10, string $linkTemplate = '?page={page}')
```

- `$page` : Geçerli sayfa
- `$totalRow` : Sayfalanacak toplam satır/içerik sayısı
- `$perPageLimit` : Sayfa başına listelenecek satır/içerik sayısı
- `$linkTemplate` : Sayfaların link şablonunu tanımlar.

### `getPage()`

[](#getpage)

Geçerli sayfayı döndürür.

```
public function getPage(): int
```

### `getLimit()`

[](#getlimit)

Sayfa başına gösterilen içerik/satır sayısını döndürür.

```
public function getLimit(): int
```

### `getOffset()`

[](#getoffset)

Geçerli sayfanın son satır/içerik sayısını döndürür.

```
public function getOffset(): int
```

### `linkTemplate()`

[](#linktemplate)

Link şablonunu tanımlar.

```
public function linkTemplate(string $template): self
```

### `setPerPageLimit()`

[](#setperpagelimit)

Sayfa başına gösterilen satır/içerik sayısını tanımlar.

```
public function setPerPageLimit(int $perPageLimit = 10): self
```

### `setTotalRow()`

[](#settotalrow)

Sayfalanacak toplam satır/içerik sayısını tanımlar.

```
public function setTotalRow(int $totalRow = 0): self
```

### `setHowDisplayedPage()`

[](#sethowdisplayedpage)

Gösterilecek toplam sayfa sayısını tanımlar.

```
public function setHowDisplayedPage(int $howDisplayedPage = 8): self
```

- `$howDisplayedPage` : Bir çift sayı.

### `getPagination()`

[](#getpagination)

Sayfalama HTML'i oluşturabileceğiniz bir dizi döndürür.

```
public function getPagination(): array
```

Dönecek dizi şuna benzer;

```
array(
    array(
        'url' => 'http://example.com/page/1',
        'page => 1,
        'active' => false
    ),
    array(
        'url' => 'http://example.com/page/2',
        'page => 2,
        'active' => true
    ),
    array(
        'url' => 'http://example.com/page/3',
        'page => 3,
        'active' => false
    )
);
```

### `nextPage()`

[](#nextpage)

Varsa sonraki sayfanın URL'sini içeren bir dizi döndürür. Yoksa `NULL` döndürür.

```
public function nextPage(): array|null
```

Dönecek dizi şuna benzer;

```
[
    'url'   => 'http://example.com/?page=4',
    'page'  => 4,
];
```

### `prevPage()`

[](#prevpage)

Varsa önceki sayfanın URL'sini içeren bir dizi döndürür. Yoksa `NULL` döndürür.

```
public function prevPage(): array|null
```

Dönecek dizi şuna benzer;

```
[
    'url'   => 'http://example.com/?page=3',
    'page'  => 3,
];
```

### `showPagination()`

[](#showpagination)

Bootstrap 5 için uyumlu bir pagination oluşturur ve döndürür.

```
public function showPagination(array $configs = []): string
```

`$configs` dizisi aşağıdaki elemanlara sahip olabilir;

- `ul_class` : `ul` html etiketinin class niteliğine eklenecek dize.
- `li_class` : `li` html etiketinin class niteliğine eklenecek dize.
- `prev_display` : Önceki sayfa iteminin eklenip eklenmeyeceğini belirten mantıksal değer. Varsayılan `true`.
- `next_display` : Sonraki sayfa iteminin eklenip eklenmeyeceğini belirten mantıksal değer. Varsayılan `true`.
- `prev_li_class` : Önceki sayfa iteminin class niteliğine eklenecek dize.
- `next_li_class` : Sonraki sayfa iteminin class niteliğine eklenecek dize.
- `prev_text` : Önceki sayfa iteminde görünecek dize. Varsayılan `"Previous"`
- `next_text` : Sonraki sayfa iteminde görünecek dize. Varsayılan `"Next"`

Kullanımı
---------

[](#kullanımı)

```
$pagination = new \MuhammetSafak\Pagination\Pagination(1, 100, 10, 'https://www.example.com/page/{page}');
```

Lisans
------

[](#lisans)

Bu kütüphane [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) tarafından geliştirilip [MIT Lisansı](./LICENSE) ile birlikte dağıtılmaktadır.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1477d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b6b34f3ac8938d8ee52ba3bd260680855dc5715c7b2929d9380de30d15a67dd?d=identicon)[muhammetsafak](/maintainers/muhammetsafak)

---

Top Contributors

[![muhammetsafak](https://avatars.githubusercontent.com/u/104234499?v=4)](https://github.com/muhammetsafak "muhammetsafak (2 commits)")

### Embed Badge

![Health badge](/badges/muhammetsafak-php-pagination/health.svg)

```
[![Health](https://phpackages.com/badges/muhammetsafak-php-pagination/health.svg)](https://phpackages.com/packages/muhammetsafak-php-pagination)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
