Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveosoule/6367118 to your computer and use it in GitHub Desktop.
Save steveosoule/6367118 to your computer and use it in GitHub Desktop.
PHP Bootstrap Alert Helper Function
<?
// @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;
}
?>
@sagarmali89
Copy link

sestr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment