php - Laravel in a subfolder and pagination -
i've laravel project in sub (sub) folder root folder , using simplepaginate() method in views. after little search i've noticted abstractpaginator
used , provides method url()
somewhere down road invoked bootstrapthreenextpreviousbuttonrenderertrait
gets called simplebootstrapthreepresenter
.
i've been searching in config/app.php
, helpers.php
file find pointing solution. haven't found yet.
how can set laravel (5.1) use subfolder structure pagination class?
i've solved modifying bootstrapthreenextpreviousbuttonrenderertrait
. i'm aware have modified abstractpaginator
since i'm not overseeing consequences of right i've chosen tailor trait needs, so:
<?php namespace illuminate\pagination; use illuminate\support\facades\request; trait bootstrapthreenextpreviousbuttonrenderertrait { /** * previous page pagination element. * * @param string $text * @return string */ public function getpreviousbutton($text = '«') { // if current page less or equal one, means can't go // further in pages, render disabled previous button // when case. otherwise, give active "status". if ($this->paginator->currentpage() <= 1) { return $this->getdisabledtextwrapper($text); } $url = url() . '/' . request::path() . '?page=' . ($this->paginator->currentpage() - 1); //laravel shipped code disabled because of installation in sub-sub folder. //$url = $this->paginator->url( // $this->paginator->currentpage() - 1 //); return $this->getpagelinkwrapper($url, $text, 'prev'); } /** * next page pagination element. * * @param string $text * @return string */ public function getnextbutton($text = '»') { // if current page greater or equal last page, means // can't go further pages, we're on last page // available, make "next" link style disabled. if (! $this->paginator->hasmorepages()) { return $this->getdisabledtextwrapper($text); } $url = url() . '/' . request::path() . '?page=' . ($this->paginator->currentpage() + 1); //laravel shipped code disabled because of installation in sub-sub folder. //$url = $this->paginator->url($this->paginator->currentpage() + 1); return $this->getpagelinkwrapper($url, $text, 'next'); } }
Comments
Post a Comment