= Html::encode($this->title) ?> = Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?>
= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'order',
'headerOptions' => ['class' => 'order'],
'format' => 'raw',
'value' => function($model) {
return '
' ;
}
],
[
'attribute' => 'photo',
'format' => 'raw',
'headerOptions' => ['class' => 'td-photo'],
'value' => function($model) {
if(strlen($model->photo)) {
$url = Url::frontend() ;
return '
' ;
}
return '' ;
}
],
'nom',
'description',
[
'attribute' => 'actif',
'headerOptions' => ['class' => 'actif'],
'contentOptions' => ['class' => 'center'],
'format' => 'raw',
'value' => function($model) {
if($model->actif)
{
return '
oui' ;
}
else {
return '
non' ;
}
}
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {delete}',
'headerOptions' => ['class' => 'actions'],
'buttons' => [
'update' => function ($url, $model) {
return Html::a('
Modifier', $url, [
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default'
]);
},
'delete' => function ($url, $model) {
return Html::a('
Suprimer', $url, [
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default'
]);
}
],
],
],
]); ?>