How to set firstPageLabel and lastPageLabel inside ActiveDataProvider pagination

When I am creating custom pagination I am displaying "first" and "last" buttons on my pager like this:

<?php echo LinkPager::widget([

    'pagination' => $pagination,

    'firstPageLabel' => 'First',

    'lastPageLabel' => 'Last',



Now I am using ActiveDataProvider, and would like to set the same thing, but I do not know how. I have tried this, but it is not working, I get error:

$dataProvider = new ActiveDataProvider([

    'query' => $query,

    'sort'=> ['defaultOrder' => ['id' => SORT_DESC]],

    'pagination' => [

        'pageSize' => 20,

        'firstPageLabel' => 'First',

        'lastPageLabel' => 'Last',



Is there any way to do this ?

ActiveDataProvider doesn’t deal with the pager itself. You can set it up in the widget that uses data provider like GridView (option $pager).

Thank you !