|
|
|
|
|
|
|
|
'dataProvider' => $dataProviderPointsSale, |
|
|
'dataProvider' => $dataProviderPointsSale, |
|
|
'summary' => '', |
|
|
'summary' => '', |
|
|
'columns' => [ |
|
|
'columns' => [ |
|
|
'name', |
|
|
|
|
|
'locality', |
|
|
|
|
|
|
|
|
[ |
|
|
|
|
|
'attribute' => 'name', |
|
|
|
|
|
'format' => 'raw', |
|
|
|
|
|
'contentOptions' => ['class' => 'name'], |
|
|
|
|
|
'value' => function($model) { |
|
|
|
|
|
$html = '<span class="the-name">'.Html::encode($model->name).'</span>' ; |
|
|
|
|
|
if(strlen($model->locality)) { |
|
|
|
|
|
$html .= '<br />à '.Html::encode($model->locality) ; |
|
|
|
|
|
} |
|
|
|
|
|
return $html ; |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
[ |
|
|
[ |
|
|
'label' => 'Jours de livraison', |
|
|
'label' => 'Jours de livraison', |
|
|
'value' => function($model) { |
|
|
'value' => function($model) { |
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'attribute' => 'photo', |
|
|
'attribute' => 'photo', |
|
|
'format' => 'raw', |
|
|
'format' => 'raw', |
|
|
'headerOptions' => ['class' => 'td-photo'], |
|
|
|
|
|
|
|
|
'contentOptions' => ['class' => 'photo'], |
|
|
'value' => function($model) { |
|
|
'value' => function($model) { |
|
|
if(strlen($model->photo)) { |
|
|
if(strlen($model->photo)) { |
|
|
return '<img class="photo-product" src="'.Yii::$app->urlManagerProducer->baseUrl.'/uploads/'.$model->photo.'" />' ; |
|
|
return '<img class="photo-product" src="'.Yii::$app->urlManagerProducer->baseUrl.'/uploads/'.$model->photo.'" />' ; |
|
|
|
|
|
|
|
|
return '' ; |
|
|
return '' ; |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
'name', |
|
|
|
|
|
'description', |
|
|
|
|
|
|
|
|
[ |
|
|
|
|
|
'attribute' => 'name', |
|
|
|
|
|
'format' => 'raw', |
|
|
|
|
|
'contentOptions' => ['class' => 'name'], |
|
|
|
|
|
'value' => function($model) { |
|
|
|
|
|
$html = '<span class="the-name">'.Html::encode($model->name).'</span>' ; |
|
|
|
|
|
if(strlen($model->description)) { |
|
|
|
|
|
$html .= ' / '.Html::encode($model->description) ; |
|
|
|
|
|
} |
|
|
|
|
|
if(strlen($model->recipe)) { |
|
|
|
|
|
$html .= '<br />'.Html::encode($model->recipe) ; |
|
|
|
|
|
} |
|
|
|
|
|
return $html ; |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
[ |
|
|
[ |
|
|
'attribute' => 'weight', |
|
|
'attribute' => 'weight', |
|
|
'value' => function($model) { |
|
|
'value' => function($model) { |
|
|
if(strlen($model->weight)) { |
|
|
if(strlen($model->weight)) { |
|
|
return $model->weight.'g' ; |
|
|
|
|
|
|
|
|
return $model->weight.' g' ; |
|
|
|
|
|
} |
|
|
|
|
|
return '' ; |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'attribute' => 'price', |
|
|
|
|
|
'value' => function($model) { |
|
|
|
|
|
if($model->price) { |
|
|
|
|
|
return Price::format($model->price) ; |
|
|
} |
|
|
} |
|
|
return '' ; |
|
|
return '' ; |
|
|
} |
|
|
} |