Add class to pagination links at CakePHP 2.2

随声附和 提交于 2019-12-11 16:26:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!