A New Button For Actioncolumn

GridView actionColumn comes with default buttons of ‘view’, ‘update’ and ‘delete’. What’s the best way to add a ‘download’ button to an actionColumn? Would appreciate if details are provided. Thanks.

Something like this, modify ActionColumn in the gridview:

    ['class' => 'yii\grid\ActionColumn',

                          'template'=>'{view} {update} {delete} {download}',


                              'download' => function ($url, $model) {     

                                    return Html::a('<span class="glyphicon glyphicon-download"></span>', $url, [

                                        'title' => Yii::t('yii', 'Download'),





1 Like

This works very good. Thank you very much.