Yii2 模式弹出窗口中缺少页眉和页脚

Yii2 模式弹出窗口中缺少页眉和页脚,yii2,bootstrap-modal,Yii2,Bootstrap Modal,我想在网格视图中有一个模式弹出窗口。我在index.php中使用了以下代码 <?php use yii\helpers\Html; use yii\grid\GridView; use backend\models\Relations; $this->title = Yii::t('app', 'Members'); $this->params['breadcrumbs'][] = $this->title; $this->registerJs("$(fun

我想在网格视图中有一个模式弹出窗口。我在index.php中使用了以下代码

<?php

use yii\helpers\Html;
use yii\grid\GridView;
use backend\models\Relations;


$this->title = Yii::t('app', 'Members');
$this->params['breadcrumbs'][] = $this->title;

$this->registerJs("$(function() {
   $('#popupModal').click(function(e) {
     e.preventDefault();
     $('#modal').modal('show').find('.modal-content')
     .load($(this).attr('href'));
   });
});");?>

<?php
    yii\bootstrap\Modal::begin([
        'id' =>'modal',
        ]);
    yii\bootstrap\Modal::end();
?>


<div class="members-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a(Yii::t('app', 'Create Members'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        // 'filterModel' => $searchModel,
        'columns' => [

            ['header'=>'Popup',
            'value'=> function($data)
                    { 
                        return  Html::a(Yii::t('app', ' {modelClass}', [
                            'modelClass' => 'View',
                        ]), ['members/view','id'=>$data->id], ['class' => 'btn btn-success','id' => 'popupModal']

                        );      
                    },
            'format' => 'raw'
            ],


            ['class' => 'yii\grid\ActionColumn','template'=>'{update}{delete}'],
        ],
    ]); ?>

</div>

现在模态正在弹出,但不是以期望的方式。我缺少页眉和页脚(没有关闭按钮)。

我使用下面的模型,我在顶部使用模态。您可以在使用时使用它。我的模态代码是这样的,它工作得很好

<?php
Modal::begin([
'id' => 'modal',
    'size'=>'modal-lg',
    'class' => '',
    ]);
echo "<div id='modalContent'></div>";
Modal::end();
?> 

<?php
Modal::begin([
'id' => 'modal',
    'size'=>'modal-lg',
    'class' => '',
    ]);
echo "<div id='modalContent'></div>";
Modal::end();
?>