SvgInline
Inline SVG file manipulation
Font Awesome Icons
Provides simple functions to add Font Awesome Icons inline. Depends on SvgInline.
echo $svg->fai('hands-wash')->title('Wash your hands');
echo $svg->fai('github', 'brands')->title('GitHub');Installation
Configuration
Configure Font Awesome Icons behavior in config/params.php under the
'yiirocks/svg-inline-fontawesome' key:
fallbackIcon string
'@vendor/fortawesome/font-awesome/svgs/solid/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.
fontAwesomeFolder string
'@vendor/fortawesome/font-awesome/svgs'Path to the Font Awesome SVGs directory.
prefix string
'svg-inline--fa'CSS class prefix for inline SVGs.
registerAssets bool
trueRegister Yii assets for Font Awesome.
style string
'solid'Default icon style variant.
Method Parameters
fai string [, string]
Name required; style
'solid'Valid name and style (optional) of a Font Awesome Icon.
Fluent API
Additional options can be chained onto the fai() 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.