T
T
Tokenchik2017-04-18 20:23:44
Yii
Tokenchik, 2017-04-18 20:23:44

Why is the button not showing in yii\bootstrap\Modal?

The button to call the modal window is not displayed, I connected it in the following way.
You have to call the window with a separate function in js, but judging by the documentation, a button should be created to call the window.

use yii\bootstrap\Modal;

<?php
    Modal::begin([
        'header' => '<h2>Hello world</h2>',
        'toggleButton' => ['label' => 'Модальное окно'],
        'footer' => 'Низ окна'
    ]);
    echo 'Содержимое окна';
    Modal::end();
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tokenchik, 2017-04-18
@Tokenchik

I fixed it, in my case it helped to remove a piece I added an onclick to the button and I call the following function'toggleButton' => ['label' => 'Модальное окно'],

function showModal() {
    $('#mainModal').modal();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question