<?php
use yii\data\ArrayDataProvider;
use common\widgets\GridView;
use yii\helpers\Html;
$dataProvider = new ArrayDataProvider([
    'allModels' => $model->alladdresses,
]);
?>

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        [
            'attribute' => 'type',
            'label' => 'Type',
            'format' => 'raw',
            'value' => function($dataModel){
                return !empty($dataModel->type) ? implode(',', $dataModel->type) : null;
            }
        ],
        'name',
        'address1',
        'address2',
        'town',
        'county',
        'country',
        'postcode',
        'phone',
        [
            'label' => 'Actions',
            'format' => 'raw',
            'value' => function($dataModel){
                $out = Html::A(html::Tag('span', '', ['class' => 'fa fa-eye']), ['/address/view', 'id' => $dataModel->id]);
                $out .= ' '.Html::A(html::Tag('span', '', ['class' => 'fa fa-pencil-alt']), ['/address/update', 'id' => $dataModel->id]);
                return $out;
            }
        ],
    ],
]); ?>