PHP code example of dizews / yii2-crud-buttons

1. Go to this page and download the library: Download dizews/yii2-crud-buttons library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dizews / yii2-crud-buttons example snippets


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

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

php composer.phar