Ratings | | Unique User Downloads | | Download Rankings |
Not enough user ratings | | Total: 231 | | All time: 8,112 This week: 310 |
|
Description | | Author |
This package can output files split into pages of limited length.
It can read the text lines of a given file and output the file lines split into pages of a limited number of lines per page.
The class can add line numbers in the beginning of each line, as well display the page number and the file path at the bottom of each page. Innovation Award
 March 2017
Number 5 |
Pagination is useful to split listings of long information into multiple pages. It is often used to split database query results into a list of Web pages.
This package can paginate an arbitrary text into a list of pages of limited line length suited to display on console terminal.
Manuel Lemos |
| |
 |
|
Innovation award
 Nominee: 1x |
|
Details
file-pager
This is a simple extension is written in PHP intended to divide a file into pages.
Installation
$ composer require nstdio/file-pager: "dev-master"
or add
"nstdio/file-pager": "dev-master"
to the require
section of your composer.json
file.
Usage
<?php
use nstdio\FilePager;
$fileName = "path/to/file";
$pageSize = 25; // lines count on page.
$pager = new FilePager($fileName, $pageSize);
$pager->setLineSeparator(LineSeparator::HTML); // All control characters will be trimmed out.
$pager->prependLine('#{line}') // prepend string to line. Available tokens {line}, {pageLine}, {path}, {file}, {dir}, {page}.
->append("{page}.");
echp $pager->getPage(1);
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.