Svg
A simple wrapper for SVG extraction.
class Winter\Storm\Support\Svg
Under the hood, this uses the "svg-sanitizer" library by Daryll Doyle (https://github.com/darylldoyle/svg-sanitizer) to sanitize and/or extract the SVG for usage within Winter.
Methods
public
static
extract (string $path, boolean $minify = true
)
: string
Extracts and sanitizes SVG code from a given file.
Parameters
Property | Type | Description |
---|---|---|
$path | string |
string
|
$minify | boolean |
boolean
|
Returns
string
public
static
sanitize (string $svg, boolean $minify = true
)
: string
Sanitizes SVG code.
See https://github.com/darylldoyle/svg-sanitizer for usage of the underlying sanitization library.
Parameters
Property | Type | Description |
---|---|---|
$svg | string |
string
|
$minify | boolean |
boolean
|
Returns
string
Copyright © 2024 Winter CMS