BenGriffiths / pdo-mysqli-pagination

A PDO & MySQLi PHP Pagination Class - PDO MySQLi Pagination class is a PHP pagination class that will work with either PDO, or MySQLi. The outputted pagination is served as a UL or as an array, and the options are extensive.
50 stars 27 forks source link

How I should change it to paginate a search result? #18

Closed satrianivzla closed 9 years ago

satrianivzla commented 9 years ago

Hi there How I should change it to paginate a search result? I already made it able to work with pretty url but I have a doubt about how others changes I need to make to have for example the results like www.mysite.com/search/string/1, where search is the page, string is the value and of course the page number

BenGriffiths commented 9 years ago

When you set your options you can define the URL structure, such as:

$searchVar = 'Whatever';

$options = array(  
    'url' => 'http://www.mysite.com/search/'.$searchVar.'/*VAR*'
);

That's clearly over simplified, but you should be able to see how it can be set.