Add first and last on all pages?

On a different page put GridView.
To add to the pager buttons first, last, then the widget you need to add
'pager' => [ 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last', ]
Is it possible somehow to register it in one place and is automatically applied to all widgets which have a pager?
July 2nd 19 at 18:16
2 answers
July 2nd 19 at 18:18
Solution
You can create a class to inherit from GridView and override firstPageLabel lastPageLabel, continue to use your class.
Here for setting default size values of the entries in the page I used bootstrap.php (DI)
Yii::$container->set('yii\data\Pagination', [
'pageSize' => 25,
"
]);
Something similar can be done? - sofia_Whi commented on July 2nd 19 at 18:21
In GridView not found firstPageLabel, lastPageLabel - sofia_Whi commented on July 2nd 19 at 18:24
Added, works fine!
public $pager = [
'firstPageLabel' => 'First',
'lastPageLabel' => 'Last'
]; - sofia_Whi commented on July 2nd 19 at 18:27
July 2nd 19 at 18:20
Solution
You can also use a DI for these purposes

Find more questions by tags Yii