Skip to content

Commit

Permalink
fixes #34
Browse files Browse the repository at this point in the history
  • Loading branch information
mootensai committed Feb 17, 2016
1 parent fa9c2a7 commit c0acac4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crud/default/views/_dataref.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@

$dataProvider = new ArrayDataProvider([
'allModels' => $model-><?= $relName; ?>,
<?php if(count($tableSchema->primaryKey) > 1):
$key = [];
foreach ($tableSchema->primaryKey as $pk) {
$key[] = "'$pk' => \$model->$pk";
}
?>
'key' => function($model){
return [<?= implode(', ',$key);?>];
}
<?php else:?>
'key' => '<?= $tableSchema->primaryKey[0] ?>'
<?php endif; ?>
]);
$gridColumns = [
['class' => 'yii\grid\SerialColumn'],
Expand Down

0 comments on commit c0acac4

Please sign in to comment.