Opoen a bootstrap modal from html::a

How can i make my html::a to open a modal bootstrap modal box?
Here is the code in my view file:

<?php
use yii\bootstrap5\Modal;
use yii\bootstrap5\BootstrapAsset;
BootstrapAsset::register($this);
use yii\helpers\Html;

?>

<?php
Modal::begin([
    'id' => 'modal-delete',
    'title' => '<h4>Confirmation</h4>',
    'size' => Modal::SIZE_SMALL,
]) ?>
<p>Are you sure you want to delete this item?</p>
<div class="modal-footer">
    <?= Html::a('Cancel', '#', [
        'class' => 'btn btn-secondary',
        'data-dismiss' => 'modal',
    ]) ?>
    <?= Html::a('Delete', ['delete', 'id' => $model->id], [
        'class' => 'btn btn-danger',
        'data-method' => 'post',
    ]) ?>
</div>
<?php Modal::end(); ?>

<div class="sys-users-view">
    <h1><?= Html::encode($this->title) ?></h1>
    <p>
        <?= Html::a(Yii::t('backend', 'Apagar'), '#', [
            'class' => 'btn btn-danger',
            'data' => [
                'toggle' => 'modal',
                'target' => '#modal-delete',
            ],
        ]) ?>
    </p>
</div>

when clicking the button nothing happens. the modal box doesn’t open. why?

Any help would be appreciated.

To those this may help:
Answer found.

replace data with this: (the bs was missing— what a bs!!!)
‘data’ => [
‘bs-toggle’ => ‘modal’,
‘bs-target’ => ‘#modal-delete’,
],

1 Like