Sometime you just want a popup
YiiBootstrap came with a great widget to render modals.
Basic example of usage is this:
<?php $this->beginWidget(
'booster.widgets.TbModal',
array('id' => 'myModal')
); ?>
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h4>Modal header</h4>
</div>
<div class="modal-body">
<p>One fine body...</p>
</div>
<div class="modal-footer">
<?php $this->widget(
'booster.widgets.TbButton',
array(
'context' => 'primary',
'label' => 'Save changes',
'url' => '#',
'htmlOptions' => array('data-dismiss' => 'modal'),
)
); ?>
<?php $this->widget(
'booster.widgets.TbButton',
array(
'label' => 'Close',
'url' => '#',
'htmlOptions' => array('data-dismiss' => 'modal'),
)
); ?>
</div>
<?php $this->endWidget(); ?>
<?php $this->widget(
'booster.widgets.TbButton',
array(
'label' => 'Click me',
'context' => 'primary',
'htmlOptions' => array(
'data-toggle' => 'modal',
'data-target' => '#myModal',
),
)
);
Here's all configuration properties which you can set for TbModal widget.
| Property | Description |
|---|---|
type name = default |
description |