Please don’t refer me to docs, it’s not there. Example from laravel
public function indexAdmin()
{
if ($this->chklog() == 'notlogged') {
return redirect('admin');
}
$page = Request::input('page', '1');
//$rowsPerPage = 10;
//$offset = ($page - 1) * $rowsPerPage;
$dogsearch = (isset($_REQUEST['psch']) <> '' ? $_REQUEST['psch'] : "");
$dogsch = $dogsearch . "%";
$aval = (isset($_REQUEST['aval']) <> '' ? $_REQUEST['aval'] : "");
Session::put('dogsearch', $dogsearch);
Session::put('dogaval', $aval);
if ($aval == "n") {
$dogrows = Dog::where('dogname', 'like', $dogsch)->where('adopted', '=', 1)->count();
}
if ($aval == "y") {
$dogrows = Dog::where('dogname', 'like', $dogsch)->where('adopted', '=', 0)->count();
}
if ($aval == "") {
$dogrows = Dog::where('dogname', 'like', $dogsch)->count();
}
Session::put('dogrows', $dogrows);
$query = Dog::where('dogname', 'like', $dogsch);
if ($aval == "n") {
$query->where('adopted', '=', 1);
} else if ($aval == "y") {
$query->where('adopted', '=', 0);
}
$dogs = $query->orderBy('lastedit', 'DESC')->paginate(5);
$pagelinks = array('psch' => $dogsearch, 'aval' => $aval);
$title = 'Admin';
$view = 'dog/indexadmin';
$layout = ViewLayout::getLayout('indexadmintp');
$content = View::make($view)
->with('dogs', $dogs)
->with('pagelinks', $pagelinks);
return view($layout)->with('content', $content)
->with('title', $title);
}
notice
$pagelinks = array('psch' => $dogsearch, 'aval' => $aval);
and in view
echo '<td>' . $dogs->appends($pagelinks)->links() . '</td>';
notice appends
I want something like
http://localhost/laravel55/dog/indexadmin?psch=c&aval=n&page=2
this part
?psch=c&aval=n&page=2
I cannot get a querystring working with pagination in cake 3.* currenty 3.6.
I am no stranger to pagination, I even did a guide in laravel
Please see guide
it shows I know pagination
https://laracasts.com/discuss/channels/guides/length-aware-paginator
I have no problems with Yii2 pagination.
I have never seen anything like the paginator in cake php where you can’t pass querystrings.
I have been through the docs 50 times, there isn’t a way to have the querystring anywhere.
I normally use my own custom paginator with cakephp, but thought I’d try the built in once more.
It doesn’t do anything except give the page=whatever page
Why can’t a good paginator like laravel’s be put into cakephp, so easy to use.
Thankfully I can write my own, but that’s not the point.
Does anyone know how to also use querystring parameters in conjuction with pagination??
I am also number 20 on laravel leaderboard, I am pretty good at laravel.
I state that not as a brag, but to not be toyed with, as I am not new to this stuff.
Every time I fiddle around with cake pagination, I give up in an hour.
Both laravel and yii2 I had the pagination all figured out in 15 minutes.
The custom lengthaware paginator in laravel did take a longer while, I admit.