|
- <?php
-
- use yii\helpers\Html;
- use yii\grid\GridView;
-
- /* @var $this yii\web\View */
- /* @var $dataProvider yii\data\ActiveDataProvider */
-
- $this->title = 'Produits';
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <div class="produit-index">
-
- <h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>
-
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'columns' => [
- [
- 'attribute' => 'order',
- 'headerOptions' => ['class' => 'order'],
- 'format' => 'raw',
- 'value' => function($model) {
- return '<a class="btn-order btn btn-default" href="javascript:void(0);"><span class="glyphicon glyphicon-resize-vertical"></span></a>' ;
- }
- ],
- 'diminutif',
- 'nom',
- [
- 'attribute' => 'actif',
- 'headerOptions' => ['class' => 'actif'],
- 'contentOptions' => ['class' => 'center'],
- 'format' => 'raw',
- 'value' => function($model) {
- if($model->actif)
- {
- return '<span class="label label-success">oui</span>' ;
- }
- else {
- return '<span class="label label-danger">non</span>' ;
- }
- }
- ],
-
- [
- 'class' => 'yii\grid\ActionColumn',
- 'template' => '{update} {delete}',
- 'headerOptions' => ['class' => 'actions'],
- 'buttons' => [
- 'update' => function ($url, $model) {
- return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [
- 'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default'
- ]);
- },
- 'delete' => function ($url, $model) {
- return Html::a('<span class="glyphicon glyphicon-trash"></span> Suprimer', $url, [
- 'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default'
- ]);
- }
- ],
- ],
- ],
- ]); ?>
-
- </div>
|