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('hipanel', '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 renderSorter(array $options)
153
    {

src/widgets/IndexPage.php 1 location

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