Yii2 textInput弹出modal

textInput
<?= $form->field($model, 'student_id')
->textInput(['data-toggle' => 'modal','data-target' => '#modal-id']) ?>

modal原生写法

<div class="modal fade" id="modal-id" tabindex="2" 
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" 
aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    标题
                </h4>
            </div>
            <div class="modal-body">
                内容
            </div>
        </div>
    </div>
</div>
发布了14 篇原创文章 · 获赞 8 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/wm20000/article/details/89217302