nstdio/file-pager

This package is abandoned and no longer maintained. No replacement package was suggested.

A simple file paginator.

dev-master 2016-08-02 07:21 UTC

This package is not auto-updated.

Last update: 2020-01-24 16:09:46 UTC


README

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);