|
- <?php
-
-
-
- use common\helpers\Price;
- use yii\helpers\Html;
- use yii\grid\GridView;
-
- $this->setTitle('Tranches de prix');
- $this->addBreadcrumb($this->getTitle());
- $this->addButton(['label' => 'Nouvelle tranche de prix <span class="glyphicon glyphicon-plus"></span>', 'url' => 'producer-price-range-admin/create', 'class' => 'btn btn-primary']);
-
- ?>
-
- <?= GridView::widget([
- 'dataProvider' => $dataProviderProducerPriceRange,
- 'columns' => [
- [
- 'attribute' => 'range_begin',
- 'value' => function ($model) {
- return Price::format($model->range_begin);
- }
- ],
- [
- 'attribute' => 'range_end',
- 'value' => function ($model) {
- if($model->range_end) {
- return Price::format($model->range_end);
- }
- return '';
- }
- ],
- [
- 'attribute' => 'price',
- 'value' => function ($model) {
- return Price::format($model->price);
- }
- ],
- [
- 'class' => 'yii\grid\ActionColumn',
- 'template' => '{update} {delete}',
- 'headerOptions' => ['class' => 'column-actions'],
- 'contentOptions' => ['class' => 'column-actions'],
- 'buttons' => [
- 'update' => function ($url, $model) {
- return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [
- 'title' => 'Modifier', 'class' => 'btn btn-default'
- ]);
- },
- 'delete' => function ($url, $model) {
- return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [
- 'title' => 'Supprimer', 'class' => 'btn btn-default'
- ]);
- }
- ],
- ],
- ],
- ]); ?>
|