SvgInline
Inline SVG file manipulation
Bootstrap Icons
Provides simple functions to add Bootstrap Icons inline. Depends on SvgInline.
echo $svg->bootstrap('alarm')->title('Wake Up');Installation
Configuration
Configure Bootstrap Icons behavior in config/params.php under the
'yiirocks/svg-inline-bootstrap' key:
bootstrapIconsFolder string
'@vendor/twbs/bootstrap-icons/icons'Path to the Bootstrap Icons directory.
fallbackIcon string
'@vendor/twbs/bootstrap-icons/icons/question.svg'Default icon to use when the requested icon is unavailable.
fill string
'currentColor'Default SVG fill color.
fixedWidth bool
falseDefault fixed-width icon rendering.
prefix string
'bi'CSS class prefix for inline SVGs.
Method Parameters
bootstrap string
Required
Valid name of a Bootstrap Icon.
Fluent API
Additional options can be chained onto the bootstrap() call:
class string
nullAdditional custom classes.
css array
nullAdditional CSS attributes.
fill string
'currentColor'Color of the icon.
fixedWidth bool
falseSet to true to have a fixed width icon.
height int
nullThe height of the icon. If height is given without width, the latter will be calculated from the SVG size.
id string
nullId for the SVG tag.
title string
nullSets a title to the SVG output. Defaults to the icon name, capitalized.
width int
nullThe width of the icon. If width is given without height, the latter will be calculated from the SVG size.