chrisblackwell's avatar

Change Pagination Markup (L5)

Does anyone know how to override the markup for the pagination to match Foundation 5? I know this use to be doable in Laravel 4 but can't seem to get it working in Laravel 5.

0 likes
2 replies
RomainLanz's avatar

You can inject a Presenter on the render method.

/**
 * Render the paginator using the given presenter.
 *
 * @param  \Illuminate\Contracts\Pagination\Presenter|null  $presenter
 * @return string
 */
public function render(Presenter $presenter = null)
{
    $presenter = $presenter ?: new SimpleBootstrapThreePresenter($this);
    return $presenter->render();
}
1 like
erikbelusic's avatar

i just ran into this today. i ended up creating a class that extended the BootstrapThreePresenter and i overwrote the methods where the markup is generated. Then i used the static method on the AbstractPresenter class to always use my new presenter as the default so i do not need to inject it every time i call render somewhere

Please or to participate in this conversation.