04-20-2020, 11:40 AM
Pagination works simple and well when I list my db with 600 records
But when I have to include a search, only the first page of the pagination works well and counts the records correctly, when I click on the second page the system disregards the item searched and returns to list all the pages.
Please help me to implement the code correctly.
But when I have to include a search, only the first page of the pagination works well and counts the records correctly, when I click on the second page the system disregards the item searched and returns to list all the pages.
Please help me to implement the code correctly.
Code:
public function search(){
$model = new MyModel;
$name = $this->request->getVar('name') ;
$data = [
'value' => $model->orderBy('uf', 'asc')
->like('name', $name)
->paginate(10),
'pager' => $model->pager
];
echo view('mycontroller/search',$data);
}