PHP Classes
elePHPant
Icontem

File Pager: Output files split into pages of limited length

Recommend this page to a friend!
  Info   View files Documentation   View files View files (18)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-01-20 (11 months ago) RSS 2.0 feedNot enough user ratingsTotal: 226 All time: 7,802 This week: 576Up
Version License PHP version Categories
file-pager 1.0.0Custom (specified...5PHP 5, Files and Folders
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
PHP Programming Innovation award nominee
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
Name: Edgar Asatryan <contact>
Classes: 4 packages by
Country: Armenia Armenia
Age: ???
All time rank: 31638 in Armenia Armenia
Week rank: 209 Up2 in Armenia Armenia Up
Innovation award
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);
  Files folder image Files  
File Role Description
Files folder imagesrc (9 files)
Files folder imagetests (6 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file Cache.php Class Class source
  Plain text file CacheItem.php Class Class source
  Plain text file CorruptedDataException.php Class Class source
  Plain text file File.php Class Class source
  Plain text file FilePager.php Class Class source
  Plain text file Handler.php Class Class source
  Plain text file LineSeparator.php Class Class source
  Plain text file Output.php Class Class source
  Plain text file OutputInterface.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file ClosureAsOutputHandlerTest.php Class Class source
  Plain text file FileSystemTest.php Class Class source
  Plain text file MockFile.php Class Class source
  Plain text file OutputTest.php Class Class source
  Plain text file PageSizeTest.php Class Class source
  Accessible without login Plain text file phpunit.xml Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:226
This week:0
All time:7,802
This week:576Up