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 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 127 This week: 1All time: 8,460 This week: 693Up
Version License PHP version Categories
file-pager 1.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.

Name: Edgar Asatryan <contact>
Classes: 3 packages by
Country: Armenia Armenia
Age: ???
All time rank: 35859 in Armenia Armenia
Week rank: 359 Up3 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:127
This week:1
All time:8,460
This week:693Up