Answer the question
In order to leave comments, you need to log in
How to set global settings for the GridView module in the config?
How to set global settings for the GridView module in the config?
In order not to write in each module:
'pager' => [
'firstPageLabel' => false,
'lastPageLabel' => false,
'prevPageLabel' => false,
'nextPageLabel' => false,
'maxButtonCount' => 5,
'options' => [
'tag' => 'div',
'class' => 'pagination',
'id' => 'pager-container',
],
'linkOptions' => ['class' => 'page-link'],
'disabledPageCssClass' => 'page-item disabled',
'activePageCssClass' => 'page-item active',
],
Answer the question
In order to leave comments, you need to log in
It makes more sense to do this through DI , specifying the default parameters for this class in your config file.
For example, in your case it will be like this
// file config/main.php
[
//...
'components' => [//...
],
'container' => [
'definitions' => [
'yii\grid\GridView' => [
'firstPageLabel' => false,
'lastPageLabel' => false,
'prevPageLabel' => false,
'nextPageLabel' => false,
'maxButtonCount' => 5,
'options' => [
'tag' => 'div',
'class' => 'pagination',
'id' => 'pager-container',
],
'linkOptions' => ['class' => 'page-link'],
'disabledPageCssClass' => 'page-item disabled',
'activePageCssClass' => 'page-item active',
],
],
],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question