I created a media library with some tabs (images,videos,audios,files) ; each tab contains a list with the related entitys and a paginator. So I have 4 paginated lists in my view.
My controller set up for paginate looks like:
public $paginate = [
‘Images’ => [‘limit’ => 10, ‘scope’ => ‘image’],
‘Videos’ => [‘limit’ => 8, ‘scope’ => ‘video’],
In my controller action i set the values like :
$images = $this->paginate($imageTable->find(‘all’,$image_options), [‘scope’ => ‘image’]);
$videos = $this->paginate($videosTable->find(‘all’, $video_options), [‘scope’ => ‘video’]);
In my views i set the paginator :
$paginator->numbers([‘model’ => ‘Images’])
Now I have all lists with the paginator and it works for all pages with a link structure like :
but for all paginators the link for the first page is looking equal like:
so i can’t differentiate which page 1 I have to load.
I load the pages with ajax.
What I am doing wrong?
Or how I can change the generated link for the
- ->prev() (if prev is first page) and
to add at least the scope at the end of the url so I can get url’s for the first pages like:
…/media?video or …/media?video[page]=1