Last active
October 7, 2016 15:42
-
-
Save fotan/7e7bce8503dc47acbcec53a94a8c7705 to your computer and use it in GitHub Desktop.
BS3 - Dynamic Alerts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set $alert_type and $message somewhere else | |
<?php if(isset($message)) { ?> | |
<br /> | |
<div class="row"> | |
<?php | |
// Add ability to display different types of alerts. | |
// For backwards compatibility, if $alert-type isn't set, set it to alert-info. | |
// Options are: success = green | |
// info = blue | |
// warning = yellow | |
// danger = red | |
if(!$alert_type) { | |
$alert_type = "info"; | |
} | |
?> | |
<div class="alert alert-<?php echo $alert_type; ?> alert-dismissible" role="alert"> | |
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> | |
<?php echo $message; unset($message); ?> | |
</div> | |
</div> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment