Global Config Array
This method allows you to set the pagination configuration by setting a global config array.
Config::set('pagination', array(
'pagination_url' => 'http://docs.fuelphp.com/',
'uri_segment' => 2,
'total_items' => 10,
'per_page' => 20,
'template' => array(
'wrapper_start' => '<div class="pagination"> ',
'wrapper_end' => ' </div>',
'page_start' => '<span class="page-links"> ',
'page_end' => ' </span>',
'previous_start' => '<span class="previous"> ',
'previous_end' => ' </span>',
'previous_inactive_start' => ' <span class="previous-inactive">',
'previous_inactive_end' => ' </span>',
'previous_inactive_attrs' => array(),
'previous_mark' => '« ',
'previous_attrs' => array(),
'next_start' => '<span class="next"> ',
'next_end' => ' </span>',
'next_inactive_start' => ' <span class="next-inactive">',
'next_inactive_end' => ' </span>',
'next_inactive_attrs' => array(),
'next_mark' => ' »',
'next_attrs' => array(),
'active_start' => '<span class="active"> ',
'active_end' => ' </span>',
'active_attrs' => array(),
'regular_start' => '',
'regular_end' => '',
'regular_attrs' => array(),
),
));
If you have a standard configuration for your entire application, you can also opt to store this structure in the app/config/pagination.php config file, so you don't have to define it every time.