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

@@ 190-205 (lines=16) @@
187
        return AdvancedSearch::renderButton() . "\n";
188
    }
189
190
    public function renderPerPage()
191
    {
192
        return ButtonDropdown::widget([
193
            'label' => Yii::t('app', 'Per page') . ': ' . (Yii::$app->request->get('per_page') ?: 25),
194
            'options' => ['class' => 'btn-default btn-sm'],
195
            'dropdown' => [
196
                'items' => [
197
                    ['label' => '25',  'url' => Url::current(['per_page' => null])],
198
                    ['label' => '50',  'url' => Url::current(['per_page' => 50])],
199
                    ['label' => '100', 'url' => Url::current(['per_page' => 100])],
200
                    ['label' => '200', 'url' => Url::current(['per_page' => 200])],
201
                    ['label' => '500', 'url' => Url::current(['per_page' => 500])],
202
                ],
203
            ],
204
        ]);
205
    }
206
207
    /**
208
     * Renders button to choose representation.