dizews/yii2-crud-buttons

It is a widget for Yii2 framework which control a crud buttons.

Installs: 1 104

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 0

Type:yii2-extension

0.1.1 2014-08-06 21:24 UTC

This package is auto-updated.

Last update: 2024-10-20 22:53:04 UTC


README

It is a widget for Yii2 framework which control a crud buttons.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist dizews/yii2-crud-buttons "0.1.*"

or add

"dizews/yii2-crud-buttons": "0.1.*"

to the require section of your composer.json.

General Usage

<?= CrudButtons::widget(['model' => isset($model) ? $model : null]); ?>

If you want to get more understandable titles of buttons you should set modelName.

<?= CrudButtons::widget(['model' => isset($model) ? $model : null,
    'modelName' => function ($actionId) {
        $count = 1;
        if ($actionId == 'multi-update' || $actionId == 'multi-delete') {
            $count = 10; //any number for plural
        }
        return Yii::t('app', '{n, plural, =1{User} other{Users}}', ['n' => $count])
    }
]); ?>