'How to change pagination in easyadmin 3

I am using symfony 5.2 and easyadmin 3 for backend. In the easyadmin 3 there is default pagination style and structure is like Previous | Next. Now, I need to change pagination like First | Previous | 1 | 2 | 3 | 4 | 5 | Next | Last.

Is there any way to change pagination in symfony easyadmin 3.



Solution 1:[1]

found this here. It is missing the [first] and [last] options but maybe this is a start.

public function configureCrud(Crud $crud): Crud
{
    return $crud
        [...]

        // the number of pages to display on each side of the current page
        // e.g. if num pages = 35, current page = 7 and you set ->setPaginatorRangeSize(4)
        // the paginator displays: [Previous]  1 ... 3  4  5  6  [7]  8  9  10  11 ... 35  [Next]
        // set this number to 0 to display a simple "< Previous | Next >" pager
        ->setPaginatorRangeSize(4)

        [...]
    ;
}

Solution 2:[2]

Using EasyAdmin 4 this seems to be the default now: enter image description here

The page numbers of the first and the last page are always visible, so there's no need for extra buttons (any more).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Black-Shadow
Solution 2 Select0r