Pagination Path Changes After Livewire Update
After a Livewire component re-renders, the pagination path changes to livewire/update/page/, which disrupts the functionality of pagination links.
The Pagi library uses get_pagenum_link, which relies on REQUEST_URI as the reference URL for the path.
To address this, I temporarily modified the REQUEST_URI as follows:
$tmp = $_SERVER['REQUEST_URI'];
$_SERVER['REQUEST_URI'] = $this->baseUrl;
$links = PagiFacade::build()->links();
$_SERVER['REQUEST_URI'] = $tmp;
Is there any other recommended solution to resolve this issue?
Thank you in advance
That's an annoying issue 😦
Would it be possible to just filter get_pagenum_link? Otherwise, I don't see a sane solution outside of figuring out an alternative to it in Pagi. 🤔
@aglipanci Actually, there is a get_pagenum_link filter. I will test to see if it works. Thanks.