Created
August 28, 2013 15:07
-
-
Save steveosoule/6367118 to your computer and use it in GitHub Desktop.
PHP Bootstrap Alert Helper Function
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
<? | |
// @type: string - [success, info, warning, danger] | |
// @message: string - content of alert | |
// @dismisable: boolean | |
// returns alert HTML | |
function html_alert($type, $message, $dismisable){ | |
$alert = ''; | |
$alert_class = 'alert'; | |
if ( $type ) $alert_class += ' alert-'.$type; | |
if ( $dismisable ) $alert_class += ' alert-dismissable'; | |
$alert = '<div class="'.$alert_class.'">'.$message.'</div>'; | |
return $alert; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sestr