I just want to redirect that to the last index if the last record is deleted from the last page. please help me to do this.
<?php
echo $this->Paginator->prev
($this->Html->image('prev.png'), array('escape' => false),
array(), null, array('class' => 'prev'));
echo $this->Paginator->counter
('Page {:page} of {:pages}, Total Records {:count}');
echo $this->Paginator->next($this->Html->image
('next.png'), array('escape' => false),
array(), null, array('class' => 'next'));
?>
As of CakePHP 2.3 - Out of Range page requests will throw an exception.
However the documentation is not correct in saying that the paging parameters will be available to you in $this->request->params['paging'], because those are defined after the exception is thrown. (This problem has been fixed in CakePHP 2.4.x two months ago)
So, to get the effect you want you can do something like this in your controller: