-
Notifications
You must be signed in to change notification settings - Fork 40
Modal
Matthew McNaney edited this page Aug 4, 2015
·
4 revisions
PHP
$id = 'my-modal';
$content = 'This is the modal body';
$title = 'This is the title of the modal';
$modal = new \Modal($id, $content, $title);
// wider modal
// $modal->sizeLarge();
// slimmer modal
// $modal->sizeSmall();
$modal->addButton('<button id="do-something">Do something</button>');
$template = \Template(array('modal'=>$modal), 'template.html');
echo $template;
template.html
<button id="open-modal">Open Modal</button>
<?=$modal?>
Javascript
$(window).load(function() {
$('#open-modal').click(function(){
$('#my-modal').modal('show');
});
});