rafaelteboekhort56195
rafaelteboekhort56195

Hello there! Im new at octobercms and I love it! Lots to learn though. So, I managed to connect a database through a model to my website. Now I want to paginate the results. All works fine. I just want to change the generated html by .render in {{ users.render|raw }} Can anyone tell me how to do this? Im looking through the documentation but probably I am not finding anything.. Best, Rafael

mjauvin
mjauvin
mjauvin

You can also pass a view to the render method:

public function render($view = null, $data = [])
rafaelteboekhort56195
rafaelteboekhort56195

Thanks a lot mjauvin!! Putting your tips to work right now ))

rafaelteboekhort56195
rafaelteboekhort56195

Everything works wonderfully! But I have one last small thing going on )). I have a lot of pages, say 60 or something (I did ->paginate(10)) and now I need to make the paginator have ... between the pages, like so:

<1, 2, 3 ... 6, 7, 8>

Im seraching around for something like {{ $users->onEachSide(5)->links() }} in Laravel right now

Any tips on how to build something like that?

Last updated

mjauvin
mjauvin

Doesn't onEachSide() work?

rafaelteboekhorst56221
rafaelteboekhorst56221

I think I am doing something wrong. When I add something like this in my component:

    public function loadHouses()
    {
        $hello = Houses::paginate(10)->onEachSide(5);
        return $hello;
    }

I get an error message saying:

Method onEachSide does not exist.

/var/www/html/october/myoctober/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php line 96
mjauvin
mjauvin

Looks like that got added in Laravel 5.8... October will soon be released with Laravel 6 as a foundation, so that'll work.

https://laravel.com/api/5.8/Illuminate/Pagination/LengthAwarePaginator.html

October currently uses Laravel 5.5

Last updated

1-8 of 8