Answer the question
In order to leave comments, you need to log in
How to add a class to a button in Yii2-export?
Good afternoon. I'm using the Yii2-export extension . By default, the buttons created by the plugin have the class btn btn-outline-secondary
. I am trying to insert the classes I need like this:
<?= ExportMenu::widget([
'dataProvider' => $dataProvider,
'dropdownOptions' => [
'label' => 'Export',
'class' => 'btn btn-primary btn-sm font-weight-bold',
'icon' => '<i class="fas fa-external-link-alt icon-nm"></i>'
],
'columnSelectorOptions' => [
'icon' => '<i class="fas fa-list icon-nm"></i>',
'class' => 'btn btn-primary btn-sm font-weight-bold',
],
'exportConfig' => ...
'columns' => ...
]); ?>
<button id="w4-button" class="btn btn-primary btn-sm font-weight-bold btn-outline-secondary dropdown-toggle" title="Export data in selected format" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-external-link-alt icon-nm"></i> Эскпортировать</button>
Html::addCssClass($this->dropdownOptions, ['btn', $this->getDefaultBtnCss()]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question