I’m using kartik export menu and it’s showing the error below.
PHP Strict Warning – yiibaseErrorException
kartikgridGridView and kartikbaseBootstrapTrait define the same property ($bsVersion) in the composition of kartikgridGridView. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed
Code:
use kartikgridGridView; use kartikexportExportMenu; <?php $gridColumns = [ ['class' => 'yiigridSerialColumn'], 'id', 'bi', 'num_movel', 'nome_cliente', // 'user_criacao', 'data_criacao', ['class' => 'yiigridActionColumn'], ]; ?> <div class="export-menu"> <?php echo ExportMenu::widget([ 'dataProvider' => $dataProvider, 'columns' => $gridColumns ]); ?> </div> <div class="c"></div> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, ]); ?>
What can be the cause of this since i’ve followed the kartik instructions for using the export menu?
Advertisement
Answer
I had the same issue with kartik-v: yii2-grid 3.1.9 and yii2-export 1.3.0 recent releases. To solve this issue you have two options:
- Upgrade to PHP 7.X
- Set in composer.json the specific release that is compatible with PHP 5.6.x or 5.7.x.
composer.json
"minimum-stability": "dev", "prefer-stable": true, "require": { "kartik-v/yii2-krajee-base": "1.9.3", "kartik-v/yii2-export": "1.2.9", "kartik-v/yii2-grid": "3.1.8", "kartik-v/yii2-widget-activeform": "1.5.1", },