How to clean a limit of 20 items in a RESTful API in Yii2?

Tambourine broke, need help.
In Yii2 API (version 2.0.8) to remove a limit of 20 items per page ?
It is about standard example from the documentation.
July 8th 19 at 15:51
2 answers
July 8th 19 at 15:53
Solution
Your_model is 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;
 }
you chose the road to hell))

I will have to increase the script execution time

I will have to increase the amount of memory per process

this will mean that you will not be able to handle more than one request. The web doesn't work.

I am developing an API and I constantly receive such requests from buyers. I'm tired of explaining that this is not a limitation (divide the result in pages) and good. Many people do not understand that API is not a database, which fed the query time it collects data from 100 tables and 10 databases and gives one result row. The web doesn't work. The task of the web servers to QUICKLY PROCESS MANY REQUESTS. It is easier to make 10 requests within a single keepalive connection than one request which is to lock a bunch of tables and give one line. Again the web doesn't work. - Helois commented on July 8th 19 at 15:56
: if you select 200 items from one table (for two int values each) is it better to make 4 requests ? without dainow and other - erik_Buckridge19 commented on July 8th 19 at 15:59
: is an example implementation of such a request ? - erik_Buckridge19 commented on July 8th 19 at 16:02
by the way pagination is disabled so

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

you're missing another point - uniformity of approach to building APIs. Let's say you have 2 entities - one heavy and a list of these entities, you are breaking on pages, and one easy (for two int values each) without pagination. On the client side, retrieve a list of entities have to do in 2 ways. My answer to you is the uniformity of the API. - Helois commented on July 8th 19 at 16:05
July 8th 19 at 15:55
Per-page=
there actuates a limit from 1 to 50, this option would recommend - Helois commented on July 8th 19 at 15:58
https://github.com/yiisoft/yii2/search?utf8=%E2%9C...
Limitation of cm in the source code - erik_Buckridge19 commented on July 8th 19 at 16:01
: thanks for the idea to look on github, decided through pageSizeLimit - erik_Buckridge19 commented on July 8th 19 at 16:04
: pzhl)I always do - Helois commented on July 8th 19 at 16:07

Find more questions by tags YiiPHP