Git Product home page Git Product logo

pager's Introduction

Pager

  • Version: 1.0.0
  • Author: Wilhelm Murdoch
  • Build Date: 2011-09-06
  • Requirements: Symphony 2.2.3

Purpose

To provide a hassle-free way of generating standardized pagination elements to backend pages. This is primarily used by other Symphony extensions.

Installation

  1. Upload the "pager" folder in this archive to your Symphony 'extensions' folder
  2. Enable it by selecting "Pager" in the list, choose Enable from the with-selected menu, then click Apply

Usage

Using this utility class is quite straight-forward:

$totalRecords = 50;     // Typically the value of a MySQL SELECT COUNT(1) query against a data table.
$perPage      = 15;     // Usually a call to `Symphony::Configuration()->get('pagination_maximum_rows', 'symphony')`.
$pageKey      = 'page'; // For instance: http://www.mysite.com/articles/?page=3

$Pager = Pager::factory($totalRecords, $perPage, $pageKey);

$results = Symphony::Database()->fetch("
	SELECT
		`id`,
		`title` 
	FROM `my_table`
	ORDER BY `id` DESC '.$Pager->getLimit(true)
");

// ... more code here to display page data ... 

$this->Form->appendChild($Pager->save()); // If being invoked through a backend page.

// ... OR ...

echo $Pager; // Will generate an HTML string representing the pagination bar.

Compatibility

I haven't tested this with previous versions of Symphony. But, if I had to hazard a guess, I'd say it works for Symphony 2 and up. Don't hold me to it! :)

Issues

There are currently no known issues with this extension. If you find anything wrong, feel free to submit a pull request or submit an issue to the tracker.

pager's People

Watchers

Brian Zerangue avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.