jeloqim
102
4
Laravel

Laravel Paginator object does not have render method

Posted 1 year ago by jeloqim

I do the following:

    $array = new LengthAwarePaginator(array_slice($array, $offset, $perPage, true), count($array),$perPage, $page, ['path' => $request->url(), 'query' => $request->query()]);
    dd($array->render());

and i get the proper html output of the render method.

Then I try:

    $array =  new Paginator(array_slice($array, $offset, $perPage, true), $perPage, $page, ['path' => $request->url(), 'query' => $request->query()]);
    dd($array->render());

and the output is "".

When I (dd($array)); I get :

    Paginator {#310 ▼
      #hasMore: false
      #items: Collection {#315 ▶}
      #perPage: 10
      #currentPage: 1
      #path: "https://localhost/search/3"
      #query: array:1 [▶]
      #fragment: null
      #pageName: "page"
    }

Anyone know why my Paginator doesn't have a render method? I am using 5.2.45

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.