B
B
Bahodir Ismatov2019-01-19 10:06:53
Yii
Bahodir Ismatov, 2019-01-19 10:06:53

How to send id to modal window from index page?

Hello everyone, tell me how you can render an action view on a modal window?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Osadchyi, 2019-01-19
@VladOsadchyi

here is a piece of my code, if I understand you correctly, it will help you

'buttons' => [
                    'view' => function ($url, $model) {
                        return Html::a(
                            '<i class="far fa-eye"></i>',
                            "#",
                            [
                                'data-toggle' => 'modal',
                                'data-target' => '#viewSupplier-' . $model->id,
                                'title' => 'View',
                                'aria-label' => 'View',
                                'data-pjax' => '0',
                                'class' => 'btn btn-dark btn-sm text-white'
                            ]);
                    }
<?php foreach ($dataProvider->models as $model) { ?>
    <div class="modal fade" id="viewSupplier-<?= $model->id ?>" tabindex="-1" role="dialog"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question