Code Duplication    Length = 16-16 lines in 2 locations

src/widgets/ActionBox.php 1 location

@@ 135-150 (lines=16) @@
132
        return ob_get_clean();
133
    }
134
135
    public function renderPerPage()
136
    {
137
        return ButtonDropdown::widget([
138
            'label' => Yii::t('app', 'Per page') . ': ' . (Yii::$app->request->get('per_page') ?: 25),
139
            'options' => ['class' => 'btn-default btn-sm'],
140
            'dropdown' => [
141
                'items' => [
142
                    ['label' => '25',  'url' => Url::current(['per_page' => null])],
143
                    ['label' => '50',  'url' => Url::current(['per_page' => 50])],
144
                    ['label' => '100', 'url' => Url::current(['per_page' => 100])],
145
                    ['label' => '200', 'url' => Url::current(['per_page' => 200])],
146
                    ['label' => '500', 'url' => Url::current(['per_page' => 500])],
147
                ],
148
            ],
149
        ]);
150
    }
151
152
    public function renderRepresentation()
153
    {

src/widgets/IndexPage.php 1 location

@@ 207-222 (lines=16) @@
204
        return AdvancedSearch::renderButton() . "\n";
205
    }
206
207
    public function renderPerPage()
208
    {
209
        return ButtonDropdown::widget([
210
            'label' => Yii::t('app', 'Per page') . ': ' . (Yii::$app->request->get('per_page') ?: 25),
211
            'options' => ['class' => 'btn-default btn-sm'],
212
            'dropdown' => [
213
                'items' => [
214
                    ['label' => '25',  'url' => Url::current(['per_page' => null])],
215
                    ['label' => '50',  'url' => Url::current(['per_page' => 50])],
216
                    ['label' => '100', 'url' => Url::current(['per_page' => 100])],
217
                    ['label' => '200', 'url' => Url::current(['per_page' => 200])],
218
                    ['label' => '500', 'url' => Url::current(['per_page' => 500])],
219
                ],
220
            ],
221
        ]);
222
    }
223
224
    /**
225
     * Renders button to choose representation.