Skip to content

Instantly share code, notes, and snippets.

@nebiros
Created January 14, 2010 15:53
Show Gist options
  • Save nebiros/277274 to your computer and use it in GitHub Desktop.
Save nebiros/277274 to your computer and use it in GitHub Desktop.
How to implement Zend_Paginator without Zend
<?php
defined( "APPLICATION_PATH" )
|| define( "APPLICATION_PATH", realpath( dirname( __FILE__ ) ) );
// Ensure library/ is on include_path.
set_include_path( implode( PATH_SEPARATOR, array(
realpath( APPLICATION_PATH . "/library" ), // Aca va a estar la carpeta Zend que viene con el .tag.gz del ZF
get_include_path(),
) ) );
/** Lo que haga la pagina **/
/** Implementamos por ejemplo el paginador **/
require_once "Zend/Paginator.php";
$paginator = Zend_Paginator::factory( $data ); // $data es un arreglo cualquiera, o lo que reciba el Zend_Paginator#factory.
$paginator->setItemCountPerPage( 50 );
$paginator->setCurrentPageNumber( 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment