Pagination maybe last time

New to bootstrap, my custom css would not work correct with this paginator.

Got it working with some borrowed bootstrap code. Where would I place some custom css to change link colors on paginator?

Ignore below I added this to config


'container' => [

        'definitions' => [

            'yii\widgets\LinkPager' => [

                'firstPageLabel' => 'First',

                'lastPageLabel'  => 'Last'

            ]

        ]

    ]

This is not an easy "out of the box" paginator to work with.

[s]First look at the way you can paginate here in the forum, you can jump to last page, or first page. Most frameworks built in paginator has that "out of box".

Now, however I notice the Yii2 paginator does not have that ability. How to override that to have first and last page links also. I was totally shocked when it did not show those links.[/s]

Finally had a chance to figure out the paginator. Problem API shows as an example


$disabledPageCssClass public property


The CSS class for the disabled page buttons.

public string $disabledPageCssClass = 'disabled'

But where in the World does $disabledPageCssClass variable go?

Thanks to a stackoverflow post this is correct goes in config/web.php:




'container' => [

        'definitions' => [

            'yii\widgets\LinkPager' => [

                'firstPageLabel' => 'First',

                'lastPageLabel'  => 'Last',

                'disableCurrentPageButton' => true,

                'activePageCssClass' => 'active',

                'disabledPageCssClass' => 'disabled',

                'maxButtonCount' => 7

            ]

        ]

    ]



I am just confused as to why the API shows $disabledPageCssClass when in reality it goes in an array as above.

I guess I was just used of the laravel paginator that worked out of box, but now I know how to use yii2 paginator.

The reason it goes in an array is so that all the property over-rides can be passed to the init/create function of the class in one variable. Otherwise what order do you pass them in? What if you only want to change one property? There would need to be a whole bunch of different init() functions, and if you had two properties that were strings, which init(string x) would be called?

Also


$disabledPageCssClass public property


The CSS class for the disabled page buttons.

public string $disabledPageCssClass = 'disabled'

is showing the default value is ‘disabled’, so you don’t have to pass that in again :)

jkofsky thanks for the reply.