Yii 2.0: yii2-crud-buttons

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

Crud buttons Widget

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])
    }
]); ?>

Total 2 comments

#18703 report it
dizews at 2014/12/15 07:01am
answer to Shiv

Shiv, if you have ideas how to improve this tool you can always make a pull requests.

#18416 report it
shiv at 2014/10/26 05:27pm
Liked it !

Its very useful tool. I would improve it by allowing users to add button from anywhere , may be controller or may be extensions and just use the layout with pull right.

Thank you, Shiv

Leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet