CakePHP 2 Slightly Better Looking than Default Pagination

Written by James McDonald

April 18, 2016

Just trying to make my pagination in CakePHP 2 better looking.

I added the first and last links but still had a radius on my previous and next links which looked odd and my ‘last >>’ link had a square end too. So a bit ugly really.


Following is an example of pagination links after I have turned off some of the classes on the next previous links to stop them rendering with corner radiuses, added a HTML entity of &rsaquo; and &lsaquo; instead of ‘<‘ and ‘>’ and &laquo; and &raquo; instead of ‘<<‘ and ‘>>’

Looks better.


 <div class="paging">
        echo $this->Paginator->first('&laquo; first', ['escape' => false, 'class' => 'prev']);
        echo $this->Paginator->prev('&lsaquo; ' . __('previous'), array('escape' => false, 'class' => false), null, array('class' => 'prev disabled'));
        echo $this->Paginator->numbers(array('separator' => ''));
        echo $this->Paginator->next(__('next') . ' &rsaquo;', array('escape' => false, 'class' => false), null, array('class' => 'next disabled'));
        echo $this->Paginator->last('last &raquo;', ['escape' => false, 'class' => 'next']);


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Meraki Open Source Licenses

Until today I assumed that Meraki was built in-house with only closed source software. But having a look at the...


If you have Veeam backup failing with the Updating BCD failed with Cannot update SafeBoot flag and SentinelOne is...