CakePHP pagination and the get parameters

前端 未结 8 565
逝去的感伤
逝去的感伤 2021-02-02 02:31

I have a problem with the pagination in my search page. When a user search something I have a url like domain.com/search/?s=keyword but paginator gives me links lik

8条回答
  •  说谎
    说谎 (楼主)
    2021-02-02 03:02

    I know this is old but found a simple solution that works for me. Add following in view file -

    $paginator->options(array('url' => array_merge($this->passedArgs,
    array('?' => ltrim(strstr($_SERVER['QUERY_STRING'], '&'), '&')))));
    

    Found it here

提交回复
热议问题