CakePHP pagination and the get parameters

前端 未结 8 564
逝去的感伤
逝去的感伤 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:13

    Basically you can do it like this:

    function list_results($keywords)
      {
      $data = $this->paginate('Posts', array('Post.title LIKE' => '%'.$keywords.'%'));
      }
    

提交回复
热议问题