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>
<a href="http://...example.../6">Previous</a>
<a href="http://...example.../"开发者_运维技巧>1</a>
<a href="http://...example.../6">2</a>
<strong>3</strong>
<a href="http://...example.../18">4</a>
<a href="http://...example.../24">5</a>
<a href="http://...example.../18">Next</a>
<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 ' '
.
Hope this helps someone else.
精彩评论