Hi all.

I found that Yii2 has expand parameter for REST.

Does yii2 have parameter expand_limit?

For example if I want category expand to videos, but I need only 3 videos,

How I should call it?

url/categories?expand=videos&expand_limit=3 - does it true ?

Ok I did it

public function extraFields() 


        return [

            'videos' => function ($model) {

                $videos_limit = \Yii::$app->request->get('videos_limit');

                $query = \Video::find()

                        ->where(['categorye_id' => $model->id]);



                return $query->all();





if you use yii\rest\IndexAction Controller or an inerhit class use this