Ahmed Morgan
Ahmed Morgan

Reputation: 69

How do I add an icon instead of ">>" in CakePHP pagination?

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 ?

Upvotes: 1

Views: 719

Answers (2)

Ahmed Morgan
Ahmed Morgan

Reputation: 69

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,));

Upvotes: 2

Radames E. Hernandez
Radames E. Hernandez

Reputation: 4425

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...

Upvotes: 0

Related Questions