controllers
$test = $dataProvider->getModels(); 分配过去
view index
//Yii::$app->view->params['test'] = $test;
column
[
'attribute' => 'mom',
'format' => 'raw',
'value' => function($model,$key,$index){
return ( $this->params['test'][$index]->id );
if(isset($this->params['test'][$index + 1])){
return ( $this->params['test'][$index + 1]->money );
}
}
],