0
votes

i wan't to create a custom pagination in cakePHP .

I am using function $paginator->numbers() ; it displays the page numbers like this :

1 | 2 | 3 | 4 | ...

but i want first and last buttons and two arrows for next and previous except these numbers 1, 2,3 ,4. For eg: first < > last

3

3 Answers

0
votes

just configure paginator with these options :-

echo $paginator->prev(' previous ', null, null, null);
echo $paginator->next(' next ', null, null, null);

For more option please refer to : Pagination in cakephp

0
votes

You can customize the pagination output using the helper itself. There are custom methods available to generate links for first, last, next and previous page.

For example, to generate previous page link,

echo $this->Paginator->prev(
  ' << ',
  array(),
  null,
  array('class' => 'prev disabled')
);

For details, see the doc here: http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html

0
votes

You can use pagination prev() & next() functions:

echo $this->Paginator->first('First Page');
echo $this->Paginator->prev('<');
echo $this->Paginator->next('>');
echo $this->Paginator->last('Last Page');

You can read in detail at CakePHP Pagination