PHP Classes

File: test/test.php

Recommend this page to a friend!
  Packages 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: v.1.1.0
Date: 3 months ago
Size: 612 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))
    ->
option('prev-text', 'Prev')
    ->
option('next-text', 'Next')
    ->
option('placeholder', '{page}')
    ->
option('url-pattern', '/category/{page}')
;

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

echo_($p1);

echo_($p2);

echo_($p3);

echo_($p1->option('type', 'selectbox'));

echo_($p2->option('type', 'selectbox'));

echo_($p3->option('type', 'selectbox'));