40 lines
1.1KB

  1. <?php
  2. $this->setTitle('Producteurs') ;
  3. ?>
  4. <h1 class="title-systeme-commande"><span class="glyphicon glyphicon-grain"></span>&nbsp;&nbsp;<?= Html::encode($this->title) ?></h1>
  5. <?=
  6. GridView::widget([
  7. 'dataProvider' => $data_provider_producers,
  8. 'summary' => '',
  9. 'columns' => [
  10. [
  11. 'attribute' => 'nom',
  12. ],
  13. [
  14. 'attribute' => 'type',
  15. ],
  16. [
  17. 'label' => 'Localisation',
  18. 'value' => function($model) {
  19. return $model->ville. ' ('.$model->code_postal.')' ;
  20. }
  21. ],
  22. [
  23. 'label' => 'Lien',
  24. 'format' => 'raw',
  25. 'value' => function($model) {
  26. $icon_lock = (strlen($model->code)) ? ' <span class="glyphicon glyphicon-lock"></span>' : '' ;
  27. $html = Html::a('Visiter',Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $model->slug]), ['class'=>'btn btn-primary']) ;
  28. $html .= $icon_lock ;
  29. return $html ;
  30. }
  31. ],
  32. ]
  33. ]);
  34. ?>