开发者

How to remove spaces from pagination on CodeIgniter?

I use the pagination helper from CodeIgniter and it works. But when I see the result in my browser, I can observ unwanted spaces. CodeIgniter seems to insert them in an automatic way.

In my view:

<div><?php echo $this->pagination->create_links(); ?></div>

The code generated behind (html):

<div>
    &nbsp;
    <a href="http://...example.../6">Previous</a>
    &nbsp;
    <a href="http://...example.../"开发者_运维技巧>1</a>
    &nbsp;
    <a href="http://...example.../6">2</a>
    &nbsp;
    <strong>3</strong>
    &nbsp;
    <a href="http://...example.../18">4</a>
    &nbsp;
    <a href="http://...example.../24">5</a>
    &nbsp;
    <a href="http://...example.../18">Next</a>
    &nbsp;
    &nbsp;
    <a href="http://...example.../30">Last</a>
</div>

So there is a space before my previous link and two spaces before my "Last" link. Same thing happens when it's reversed (two spaces after my "First" link).

Why? It really blow my mind! Please do you know how to remove them?

Any suggestions gratefully received.

Solution (thanks to uzsolt's answer) : It works with first_tag_close and last_tag_open set to '' (see comments for more details).


Maybe you can set num_tag_open and num_tag_close config variable.


After trying all sorts of things by setting the config values from both within my controller and a application/config/pagination.php file. I managed to solve it by going into system/libraries/Pagination.php and reset the default values without any '&nbsp;'.

Hope this helps someone else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜