Jump to content

pagination with table rows


froot
 Share

Recommended Posts

I'm having troubles creating a pagination with rows from a ProFields table.

$indices = array('title', 'address', 'country'); // those are the fields that I want to search
$matches = new PaginatedArray;
$category = 'whatever';
$limit = 'limit=25';
$o = '~%='; // the operator :D 
$q = 'whatever';

foreach ($indices as $i) :
    $items = $page->table("$i$o$q, category~%=$category");
    foreach ($rows as$r) :
        $matches->add($r);
    endforeach;
endforeach;

This works it filters alright with both criteria. I have to do this looping, many other ways failed because multiple selectors don't work with ProFields Table, at least for now.

But I can't get it to paginate one way or the other.

$pager = $modules->get("MarkupPagerNav"); ?>
<div><?php $pager->render($results, $options)?></div>

Thanks for help!

Link to comment
Share on other sites

but here is a general question:

When I created a

new PaginatedArray;

and then

->add($differentItems) // to it, pages and table rows, doesn't matter (or does it?)

Then I want to 

echo $pager->render($rowsAndPages, $options) // but this doesn't work

do I use

->setLimit(20)

and if so, do I do that before I add the items or after they've been added? Anyhow, page just won't paginate.

Thanks for help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...