问题
I can add a class ("myclass") to the link (previous or next) which does not contain a link.(current page) I just add the class following the default ones:
echo $this->Paginator->prev('< ', array(), null, array('class' => 'prev disabled myClass'));
And it generates something like this:
<span class="prev myClass disabled ">prev</span>
But, when the previous or the next links have a link, then i the class is not added and it generates something like this:
<span class="prev">
<a href="/tickets/tickets/index/page:1?url=tickets" rel="prev">prev</a>
</span>
How can i add a class in this cases to this pagination links?
Thanks.
回答1:
API Says the second parameter is an array for the link options so I guess you could do that:
echo $this->Paginator->prev('< ', array('class' => 'myLinkClass'), null, array('class' => 'prev disabled myClass'));
来源:https://stackoverflow.com/questions/12643410/add-class-to-pagination-links-at-cakephp-2-2