public function modal()
{
return _class('html')->modal([
'inline' => 1,
'show_close' => 1,
'header' => 'Modal header',
'body' => '<p>Some body</p>',
'footer' => form_item()->save(),
]);
}
public function modal($extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
$def_style = $extra['inline'] ? 'position: relative; top: auto; left: auto; right: auto; bottom: auto; margin: 0 auto 20px; z-index: 1; max-width: 100%; display: block; overflow-y: auto;' : '';
$extra['style'] = $extra['style'] ?: $def_style;
return '
<div class="modal" style="' . $extra['style'] . '" id="' . $extra['id'] . '">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">'
. ($extra['show_close'] ? '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' : '')
. ($extra['header'] ? '<h3>' . $extra['header'] . '</h3>' : '')
. '</div>
<div class="modal-body">' . $extra['body'] . '</div>'
. ($extra['footer'] ? '<div class="modal-footer">' . $extra['footer'] . '</div>' : '') . '
</div>
</div>
</div>';
}
Some body