2017-02-17 59 views

回答

1

你可以做到這一點的只是覆蓋的yii\grid\ActionColumnbutton屬性和設置屬性target='_blank'到鏈接。

e.g,

     [ 
          'class' => 'yii\grid\ActionColumn', 
          'buttons' => [ 
           'view' => function ($url, $model) { 
            return Html::a('<span class="glyphicon glyphicon-eye-open" title="View Details"></span>', $url, ['data-pjax' => 0, 'target' => "_blank"]); 
           }, 
             'update' => function ($url, $model) { 

            return Html::a('<span class="glyphicon glyphicon-pencil" title="Update"></span>',$url, ['data-pjax' => 0, 'target' => "_blank"]); 
           }, 
             'delete' => function ($url, $model) { 
            return Html::a('<span class="glyphicon glyphicon-trash" title= "Delete"></span>', $url, ['data-pjax' => 0, 'target' => "_blank"]); 
           }, 
            ], 
           ],