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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章