{"id":37001747,"url":"https://github.com/ashtaev/php-pagination","last_synced_at":"2026-01-14T00:23:48.337Z","repository":{"id":56949970,"uuid":"175356364","full_name":"ashtaev/php-pagination","owner":"ashtaev","description":"Simple PHP script which adds custom pagination to your website.","archived":false,"fork":false,"pushed_at":"2020-06-16T14:55:48.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-09T16:11:24.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashtaev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-13T06:01:57.000Z","updated_at":"2020-06-16T14:55:50.000Z","dependencies_parsed_at":"2022-08-21T09:20:22.444Z","dependency_job_id":null,"html_url":"https://github.com/ashtaev/php-pagination","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ashtaev/php-pagination","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtaev%2Fphp-pagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtaev%2Fphp-pagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtaev%2Fphp-pagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtaev%2Fphp-pagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashtaev","download_url":"https://codeload.github.com/ashtaev/php-pagination/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtaev%2Fphp-pagination/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T00:23:47.696Z","updated_at":"2026-01-14T00:23:48.326Z","avatar_url":"https://github.com/ashtaev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP Pagination\n=============\n\n[![Latest Stable Version](https://poser.pugx.org/ashtaev/pagination/v/stable)](https://packagist.org/packages/ashtaev/pagination)\n[![Total Downloads](https://poser.pugx.org/ashtaev/pagination/downloads)](https://packagist.org/packages/ashtaev/pagination)\n[![Latest Unstable Version](https://poser.pugx.org/ashtaev/pagination/v/unstable)](https://packagist.org/packages/ashtaev/pagination)\n[![License](https://poser.pugx.org/ashtaev/pagination/license)](https://packagist.org/packages/ashtaev/pagination)\n\nSimple PHP script which adds custom pagination to your website.\n\n## Installation\n\nInstall with composer: \n\n    composer require ashtaev/pagination\n\n## Screenshot\n\n\u003cimg src=\"examples/screenshot-pagination.png\"\u003e\u003cbr/\u003e\n    \n## Quick example\n    \n    \u003c?php\n    \n    require '../vendor/autoload.php';\n    \n    use ashtaev\\Pagination;\n    \n    $total= 1777;                  // The total number of items\n    $page = 75;                    // The current page number\n    $path = '/articles/[:page]';   // A URL for each page\n    \n    $pagination = new Pagination();\n    \n    $pages = $pagination-\u003eget($total, $page, $path);\n    \n    ?\u003e\n    \u003chtml\u003e\n      \u003chead\u003e\n        \u003clink rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css\"\u003e\n      \u003c/head\u003e\n      \u003cbody\u003e\n      \n        \u003cnav aria-label=\"Page navigation example\"\u003e\n          \u003cul class=\"pagination my-4\"\u003e\n            \u003c?php foreach ($pages as $page): ?\u003e\n              \u003c?php if($page['url']): ?\u003e\n                \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"\u003c?= $page['url'] ?\u003e\"\u003e\u003c?= $page['num'] ?\u003e\u003c/a\u003e\u003c/li\u003e\n              \u003c?php else: ?\u003e\n                \u003cli class=\"page-item disabled\"\u003e\u003ca class=\"page-link\" href=\"#\"\u003e\u003c?= $page['num'] ?\u003e\u003c/a\u003e\u003c/li\u003e\n              \u003c?php endif ?\u003e\n            \u003c?php endforeach; ?\u003e\n          \u003c/ul\u003e\n        \u003c/nav\u003e\n        \n      \u003c/body\u003e\n    \u003c/html\u003e\n    \nOutput:\n\n    \u003cnav aria-label=\"Page navigation example\"\u003e\n      \u003cul class=\"pagination my-4\"\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/1\"\u003e1\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item disabled\"\u003e\u003ca class=\"page-link\" href=\"#\"\u003e…\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/71\"\u003e71\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/72\"\u003e72\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/73\"\u003e73\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/74\"\u003e74\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item disabled\"\u003e\u003ca class=\"page-link\" href=\"#\"\u003e75\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/76\"\u003e76\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/77\"\u003e77\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/78\"\u003e78\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/79\"\u003e79\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item disabled\"\u003e\u003ca class=\"page-link\" href=\"#\"\u003e…\u003c/a\u003e\u003c/li\u003e\n        \u003cli class=\"page-item\"\u003e\u003ca class=\"page-link\" href=\"/articles/178\"\u003e178\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/nav\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashtaev%2Fphp-pagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashtaev%2Fphp-pagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashtaev%2Fphp-pagination/lists"}