Function : pagination_helper()

Description: This function let you handle easily pagination for your page list. It accepts some parameters and returns an array for provided datas.
You can use it to handle pagination within dashboard and outside.

@params Int, how many items to displays per page
@params Int, how many items are available
@params Int, current page id
@params String, current url. Pretty URL only are supported. You can use modue_url() or URL Class to generate pretty URL.
@params String, location to go if required page doesn't exists or is incorrect (404 error). Pretty Link also are supported. you can use URL class available on "get_instance()->url" to generate pretty link.

Example :

<?php
$content_per_page		=	30;
$nbr_content				=	10000;
$current_page				=	1;
$current_url				=	module_url( array( 'foo', 'bar' ) , 'module_namespace' );// returns http://www.example.com/index.php/admin/module_namespace/foo/bar
$redirect						=	get_instance()->url->site_url( array( 'error' , 'code' , 'page404') );

$pagination					=	pagination_helper( 
  $content_per_page , 
  $nbr_content,
  $current_page,
  $current_url,
  $redirect
); // Returns an Array like following
/**
$pagination[ 'start' ] 	= an int to use for SQL limit function
$pagination[ 'end' ]		= an int to use for SQL limit function
$pagination[ 'status' ]	=	code error. pageExists if requested page exists or page404 else.
$pagination[ 'pagination' ] = an array used by "bs_pagination" function
$pagination[ 'available_pages' ] = a nbr of available pages
$pagination[ 'current_page' ] = the current page id.
**/

/**
to generate Bootstrap Pagination you can use "bs_pagination" function like this
**/

bs_pagination( $pagination );