Hello. I've set up pagination for my results. I do this with a class. I also have pretty urls with mod_rewrite.

I'm wondering how to echo the urls for the paginated data.

Currently I have this below for the links.

$links .= ' ' . $prefix . '<a href="' . $this->php_self . '?' . $this->append . '&page=' . $i . '">' . $i . '</a>' . $suffix . ' ';

This echos out a link like so

/index.php?menu=tags&tag=action&page=2

My mod_rewrite works and looks like this

/tags/action/page/2

Question is.. How do I change the url in my first code to work with my mod_rewrite?

I'm using this class through my whole site so I can't just add /tags/ to the first code.. Any ideas?

Can't you subclass your class, or add a member variable to it to handle such custom change ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.