setTitle('Producteurs') ;
?>
= Html::encode($this->title) ?>
=
GridView::widget([
'dataProvider' => $dataProviderProducers,
'summary' => '',
'columns' => [
[
'attribute' => 'name',
],
[
'attribute' => 'type',
],
[
'label' => 'Localisation',
'value' => function($model) {
return $model->city. ' ('.$model->postcode.')' ;
}
],
[
'label' => 'Lien',
'format' => 'raw',
'value' => function($model) {
$iconLock = (strlen($model->code)) ? ' ' : '' ;
$html = Html::a('Visiter',Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $model->slug]), ['class'=>'btn btn-primary']) ;
$html .= $iconLock ;
return $html ;
}
],
]
]);
?>