Jump to content

Why is my pagearray returning NULL for things like limit, pager, etc?

Recommended Posts

I'm trying to do something very simple, there must be something I'm missing.

Search page with pagination.

The find is nothing special:

  $results = $pages->find("search_index#=$q, limit=5, has_parent!=2");

Dumping a print_r yields what you'd expect:

ProcessWire\PageArray Object
    [count] => 5
    [total] => 8
    [start] => 0
    [limit] => 5
    [pager] => 1 to 5 of 8
    [items] => Array
            [Page:0] => Array
                    [id] => 1211
                    [name] => brainstorming
                    [parent] => /project-stages/
                    [template] => project-stage
                    [title] => Brainstorming
                    [_pfscore] => 1

			... etc etc
            [Page:4] => Array
                    [id] => 1220
                    [name] => brand-engagement
                    [parent] => /project-stages/
                    [template] => project-stage
                    [title] => Brand Engagement
                    [_pfscore] => 1


    [selectors] => search_index#=business, limit=5, has_parent!=2

When I try to output $results->pager - I get NULL. The results I can pull, and the count I can pull, but for some reason other references are giving me NULL, even though there's obviously values there.

What am I missing?

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

  • Recently Browsing   0 members

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