我需要这个 TbButton 来打开一个带有一些 HTML 内容的模式(一个带有 youtube 视频的 iframe):
<?php
$this->widget(
'bootstrap.widgets.TbButton',
array(
'label' => Yii::t('xxx', 'xxx'),
'type' => 'info',
'size' => 'mini',
'htmlOptions' => array(
'onclick' => 'js:bootbox.modal(
"<iframe width=\"640\" height=\"480\" src=\"' . GxHtml::encode($model->video_url) . '\" frameborder=\"0\" allowfullscreen></iframe>",
"Some title"
);'
),
)
);
?>
我希望它能够创造出这样的东西:
<div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" style="display: block;" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="bootbox-close-button close" style="margin-top: -10px;">×</button>
<div class="bootbox-body">
...
</div>
</div>
<div class="modal-footer">
<button data-bb-handler="ok" type="button" class="btn btn-primary">OK</button>
</div>
</div>
</div>
</div>
但相反,它只生成以下内容:
<div class="bootbox modal fade in" tabindex="-1" style="overflow: hidden; display: block;" aria-hidden="false">
<div class="modal-header">
<a href="javascript:;" class="close">×</a>
...
</div>
<div class="modal-body">
...
</div>
</div>
由于 .modal-dialog 和 .modal-content div 缺失,模态“容器”不会显示:只有它的内容会显示(在透明背景上)。我应该在代码中添加什么以创建容器类?