Passed variable from view to other view?

Hello, i have controller


return $this->render('index', [

            'value'=>$value

        ]);

In view i have gridView widget


'columns' => [





            [

                'class'=>'kartik\grid\ExpandRowColumn',

                'value'=>function($model,$key,$index,$column)

                {

                    return GridView::ROW_COLLAPSED;


                },

                'detail'=>function($model,$key,$index,$column)

                {

                    $searchModel=new \backend\models\roomSearch();

                    $searchModel->id_room=$model->id_movie;

                    $dataProvider=$searchModel->search(Yii::$app->request->queryParams);


                    return Yii::$app->controller->renderPartial('_items',[

                        'value'=>$value, // here i have problem

                        'searchModel'=>$searchModel,

                        'dataProvider'=>$dataProvider,

                    ]);

                },

I need passed variable $value to next view, but compilator doesn’t see them in array columns.

Try


'detail'=>function($model,$key,$index,$column) use ($value) { //...

Thank you:) I tried using closuer function, but I used it in bad place (‘value’=>$value) and not worked