Welcome Guest, Not a member yet? Register   Sign In
Active Page - Pager: Segments - Bug?
#1
Question 
(This post was last modified: 07-05-2021, 06:09 AM by includebeer. Edit Reason: Your images are just a big chunk of unreadable data )

Hello, i try to get started with the Pager.

(for example my Listsite on Page 6)
$pager = \Config\Services::pager();
$pager->setPath('/vereine/p');
$data['pager']=$pager->makeLinks(6, 24, 12345,'bootstrap',4);

The Html will create fine, except for the right "active" Page! It always active on page "1"


If i now remove the Segments (in the arguments), the active Num seems to works, but without giving me a right Path:
$pager->makeLinks(6, 24, 12345,'bootstrap');

I tried different nums in Segment, nothing work.
But my Solution was then very easy, i just edited one line in the System-Library of Pager.php wich was overwrite my "currentPage"

//Old

$page = $this->groups[$group]['currentPage']; // Line 187

//changed to
if(!($page>$this->groups[$group]['currentPage'])){
     $page = $this->groups[$group]['currentPage'];
}


I dont know why it always overwrites my currentPage, if i set the $segments-arguments.
Now everything works fine for me with this "System changes" Undecided
Reply


Messages In This Thread
Active Page - Pager: Segments - Bug? - by dazzafact - 07-05-2021, 02:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB