How do I add an icon instead of ">>"
in CakePHP pagination?
The code:
echo $this->Paginator->prev('<< ', array('limit' => '10'));
Views:
<span class="prev">
<a href="#" rel="prev"> << </a>
</span>
I want it to be:
<span class="prev"><a href="#" rel="prev">
<i class="fa fa-angle-left"></i> </a>
</span>
How can I do it ?
resolved
it should use 'escape' => false
to run it as html code
example
echo $this->Paginator->prev('<i class="fa fa-angle-left"></i>', array('limit' => '6','escape' => false,));
you can use font-awesome , download it and paste files brings the package, then just add the following line in your head:
<link rel="stylesheet" href="my-route/css/font-awesome.min.css">
then just add the icon to your php like this:
echo $this->Paginator->prev('<i class="fa fa-angle-double-right"></i>', array('limit' => '10'));
you can check the diferents icons here
i hope it helps you...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.