chieff/yii2-grid-bulk-actions-widget

There is no license information available for the latest version (dev-master) of this package.

Bulk actions extension for yii 2 gridview

dev-master 2023-12-20 09:02 UTC

This package is auto-updated.

Last update: 2024-04-20 09:45:57 UTC


README

Bulk actions extension for yii 2 gridview

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist webvimark/grid-bulk-actions "*"

or add

"webvimark/grid-bulk-actions": "*"

to the require section of your composer.json file.

If you want to use this fork, add to this composer.json:

"minimum-stability": "dev",
"require": {
    "webvimark/grid-bulk-actions": "dev-master"
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/achieffment/yii2-grid-bulk-actions-widget"
    }
]

and run composer update.

Configuration

If input in GridView

use webvimark\extensions\GridBulkActions\GridBulkActions;
<?php GridBulkActions::widget([
    'gridId' => 'user-grid',
    'actions' => [
        Url::to(['bulk-activate', 'attribute' => 'status']) => GridBulkActions::t('app', 'Activate'),
        Url::to(['bulk-deactivate', 'attribute' => 'status']) => GridBulkActions::t('app', 'Deactivate'),
        '----' => [Url::to(['bulk-delete']) => GridBulkActions::t('app', 'Delete')],
    ]
])
?>