<?php

use yii\helpers\Html;
use common\widgets\GridView;

/**
 * @var yii\web\View $this
 * @var PortalPeople\shippingcosts\models\Shippingcostssearch $searchModel
 * @var yii\data\ActiveDataProvider $dataProvider
 */

$this->title = 'Shippingcosts';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="shippingcosts-index">

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [

            [
                'label' => 'Haulier',
                'attribute' => 'haulierid',
                'value' => 'haulier.name',
            ],
            [
                'attribute' => 'postcodes',
                'value' => 'postcodes',
                'contentOptions' => ['style' => 'max-width:200px; white-space: break-spaces;']
            ],
            // 'haulierid',
            //'id',
            //'language',
            //'created_by',
            //'updated_by',
            //'deleted_by',
            // 'relatedid',
            // 'centerid',
            // 'created_at',
            // 'updated_at',
            // 'deleted_at',
            // 'status',
            // 'createdby_name',
            // 'updatedby_name',
            // 'deletedby_name',
             [
                 'format' => 'html',
                 'attribute' => 'type',
                 'value' => function ($model) {
                    $out = '';
                    foreach ($model->type as $type) {
                        $out .= $type . '<br/>';
                    }
                    return $out;
                 },
            ],
            // 'prices',
            // 'notes:ntext',

            ['class' => common\widgets\ActionColumn::class,],
        ],
    ]); ?>
</div>
