casamajor Posted April 20, 2014 Share Posted April 20, 2014 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: <?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" );' ), ) ); ?> 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> </div> <div class="modal-footer"> <button data-bb-handler="ok" type="button" class="btn btn-primary">OK</button> </div> </div> </div> </div> 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> <div class="modal-body"> ... </div> </div> 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 comment Share on other sites More sharing options...
Larry Posted April 21, 2014 Share Posted April 21, 2014 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. 1 Link to comment Share on other sites More sharing options...
casamajor Posted April 24, 2014 Author Share Posted April 24, 2014 Thanks for the suggestion! I will post it there. Best, Agustín Link to comment Share on other sites More sharing options...
Recommended Posts