Created
January 17, 2016 05:30
-
-
Save c006/b534cac7ee815721c46a to your computer and use it in GitHub Desktop.
Yii2 Gridview joinwith example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?= GridView::widget([ | |
'dataProvider' => $dataProvider, | |
'filterModel' => $searchModel, | |
'columns' => [ | |
['class' => 'yii\grid\SerialColumn'], | |
'id', | |
'service_name', | |
'flat_rate', | |
/* Join width example */ | |
[ | |
'attribute' => 'country_id', | |
'label' => 'Country', | |
'value' => 'country.char2', | |
], | |
'position', | |
'active', | |
['class' => 'yii\grid\ActionColumn', | |
'template' => '<span class="nowrap">{update} {delete}</span>', | |
], | |
], | |
]); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment