PHP Classes

File: test/test.php

Recommend this page to a friend!
  Classes of Nikos M.   Alt PHP Paginator   test/test.php   Download  
File: test/test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Alt PHP Paginator
Generate pagination controls for Web pages
Author: By
Last change:
Date: 4 years ago
Size: 534 bytes
 

Contents

Class file image Download
<?php
require(dirname(__FILE__).'/../src/php/Paginator.php');

function
echo_($s)
{
    echo( ((string)
$s) . PHP_EOL . PHP_EOL);
}

echo_('Paginator.VERSION = ' . Paginator::VERSION . "\n");

$p1 = new Paginator(100, 10);

$p2 = (new Paginator(1000, 10, 3))
    ->
previousText('Prev')
    ->
nextText('Next')
    ->
placeholder('{page}')
    ->
urlPattern('/category/{page}')
;

$p3 = new Paginator(100, 10, 2);

echo_($p1);

echo_($p2);

echo_($p3);

echo_($p1->view('mobile'));

echo_($p2->view('mobile'));

echo_($p3->view('mobile'));