Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2017-01-20 (1 month ago) | | Not yet rated by the users | | Total: Not yet counted | | Not yet ranked |
|
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. | |
|
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.