Jump to content
Larry Ullman's Book Forums

Yiibooster :: Bootbox \ Bootbox.modal() Does Not Generate .modal-Dialog And .modal-Content Divs

Recommended Posts

Hi Larry,


I am learning Yii with your book and I got stuck trying to create a modal for my first Yii project: an education app.


I am using the last version of YiiBooster. I need this TbButton to open a modal that shows some HTML content:

        '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"

I expect it to create something like this:

<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 class="modal-footer">
                <button data-bb-handler="ok" type="button" class="btn btn-primary">OK</button>

But instead it generates just this:

<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 class="modal-body">

Since .modal-dialog and .modal-content divs are missing, the modal "container" does not show up: only its contents do (on transparent background). What should I add to the code so that it create the container classes as well?


Thank you!

Link to post
Share on other sites

Thanks for the interest in the book. Unfortunately I'm not an expert on YiiBooster and don't know the answer here. You may do better posting in the Yii forums, where others with more experience with YiiBooster might be able to help.

  • Upvote 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...