You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.9KB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\grid\GridView;
  4. /* @var $this yii\web\View */
  5. /* @var $dataProvider yii\data\ActiveDataProvider */
  6. $this->title = 'Points de vente';
  7. $this->params['breadcrumbs'][] = $this->title;
  8. ?>
  9. <div class="point-vente-index">
  10. <h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>
  11. <?= GridView::widget([
  12. 'dataProvider' => $dataProvider,
  13. 'columns' => [
  14. 'nom',
  15. 'localite',
  16. [
  17. 'attribute' => 'point_fabrication',
  18. 'format' => 'raw',
  19. 'value' => function($model) {
  20. if($model->point_fabrication)
  21. {
  22. return '<span class="label label-success">Oui</span>' ;
  23. }
  24. else {
  25. return '<span class="label label-danger">Non</span>' ;
  26. }
  27. }
  28. ],
  29. [
  30. 'class' => 'yii\grid\ActionColumn',
  31. 'template' => '{update} {delete}',
  32. 'headerOptions' => ['class' => 'actions'],
  33. 'buttons' => [
  34. 'update' => function ($url, $model) {
  35. return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [
  36. 'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default'
  37. ]);
  38. },
  39. 'delete' => function ($url, $model) {
  40. return Html::a('<span class="glyphicon glyphicon-trash"></span> Suprimer', $url, [
  41. 'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default'
  42. ]);
  43. }
  44. ],
  45. ],
  46. ],
  47. ]); ?>
  48. </div>