PHP Classes

File: pi_lib/plugins/MAKE-YOUR-OWN.txt

Recommend this page to a friend!
  Classes of Anderson A. Meggiolaro   Paginator Iterator   pi_lib/plugins/MAKE-YOUR-OWN.txt   Download  
File: pi_lib/plugins/MAKE-YOUR-OWN.txt
Role: Documentation
Content type: text/plain
Description: How to make a specific plugin
Class: Paginator Iterator
Iterate over listings split in page using Smarty
Author: By
Last change:
Date: 15 years ago
Size: 942 bytes
 

Contents

Class file image Download
Hello, follow these steps below to create your own plugin: - Create a file called 'you_plugin_name.php', inside the plugin's folder; (example 'pgsql.php') - We need to create 2 function inside the file : pi_pgsql_ds(&$db, $sql, &$pi) and pi_pgsql_numrows(&$db, $sql, &$pi) - The first one function must to return an array (the result set) - The second function must to return the number of TOTAL rows of the pagination, not only the rows of the result set paginated, but the entire rows of the pagination. THE PARAMETERS: - &$db : The database connection, can be whatever you want, 'object' or 'resource' - $sql : The SQL statement to be executed - &$pi : The PaginatorIterator current instance. Maybe usefull. HOW TO USE THAT: $conn=pg_connect("dbname=j15"); include('PaginatorIterator.php'); PaginatorIterator::setConnection($conn); PaginatorIterator::setHandlerFunc('pgsql'); that's it.