Alert

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

Bootstrap docs: https://getbootstrap.com/docs/5.3/components/alerts/

Alert

Syntax

$Bootstrap = new renderabootstrap5component();
echo $Bootstrap->alert($aOptions)
Returns: string

Parameters: 1

Parameter #0 [ <required> array $aOptions ] 
array of options

Output

  • text {string}
  • bgtype {string} set color by type; one of primary|secondary|success|warning|

Flags

  • icon {bool}
  • dismissable {bool}

Example

PHP snippet

$Bootstrap->alert([
  'text' => 'Info: processing request ...',
  'bgtype' => 'info',
]);

Generated html output

<div class="alert alert-info" role="alert">
Info: processing request ...
</div>