PDO4You\Pagination::setPagination PHP Method

setPagination() public static method

Sets the activation of paging
public static setPagination ( boolean $friendly_url = false )
$friendly_url boolean OPTIONAL Enables URLs friendlies
    public static function setPagination($friendly_url = false)
    {
        self::setPaging(true);
        self::setFriendlyUrl($friendly_url);
    }

Usage Example

示例#1
0
<?php

// Loading demo class
require 'DemoRegister.php';
// Example with Pagination
echo '<h2><a href=".">DEMOS</a> &rsaquo; READING WITH PAGING</h2>';
// Importing classes
use PDO4You\Pagination as pager;
// Enable pagination: If the passed value is TRUE enables paging for friendly URLs
pager::setPagination(false);
// Sets the number of records per page
//pager::setLimitPerPage(2);
// Sets the page navigation
pager::setPaginator('n');
// Creating an instance
$demo = new DemoRegister();
?>

<div class="pdo4you">
    <form method="post">
        <h3><?php 
echo $demo::ADD_NEW_USER;
?>
</h3>

        <div><?php 
echo $demo::FIRST_NAME;
?>
: <input type="text" name="firstname" /></div>
        <div><?php 
echo $demo::LAST_NAME;