Button

Use Bootstrap’s custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.

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

Button

Syntax

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

Parameters: 1

Parameter #0 [ <required> array $aOptions ] 
array of button item; handled keys are:
  • tag {string} tag to use: a|button; default: button
  • href {string} link for for a-tag
  • label {string}

Styling

  • bgtype {string} use solid bg color of primary|secondary|success|warning|…
  • bordertype {string} use border color of primary|secondary|success|warning|…

Example

PHP snippet

$Bootstrap->button([
  'bgtype' => 'primary',
  'label' => 'Hello',
]);

Generated html output

<button type="button" class="btn btn-primary">
Hello
</button>