A
A
ajky2016-06-08 19:09:04
Yii
ajky, 2016-06-08 19:09:04

How to remove the 20 item limit in Yii2 RESTful API?

The tambourine is broken, help is needed.
How to remove the limit of 20 elements per page in the Yii2 API (version 2.0.8)?
It's about the standard example from the documentation .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ajky, 2016-06-08
@ajky

Instead of Your_model - the name of your model.

public function actions(){
        $actions = parent::actions();
        unset($actions['index']);
        return $actions;
    }

    public function actionIndex(){
        $activeData = new ActiveDataProvider([
            'query' => Your_model::find(),
            'pagination' => [
                'defaultPageSize' => -1,
                'pageSizeLimit' => -1,
            ],
        ]);
        return $activeData;
    }

#
#algooptimize #bottize, 2016-06-08
@user004

Per-page=

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question