UnpackStylesFunction
extends BaseFunction
in package
Unpack a CSS style string into a hash.
Use with packStyles to manipulate CSS styles.
{% set myStyles = unpackStyles(styleString) %}
{% set myStyles = myStyles|merge({
'width': '100%',
'margin': 'auto'
}) %}
<div style="{{ packStyles(myStyles) }}"></div>
Tags
Table of Contents
- __construct() : mixed
- getDI() : mixed
- getFunctionName() : string
- Return function name
- getFunctionOptions() : mixed
- handle() : array<string|int, mixed>
- Accepts a style string and unpacks it into a hash
Methods
__construct()
public
__construct() : mixed
Return values
mixed —getDI()
public
getDI() : mixed
Return values
mixed —getFunctionName()
Return function name
public
getFunctionName() : string
Return values
string —getFunctionOptions()
public
getFunctionOptions() : mixed
Return values
mixed —handle()
Accepts a style string and unpacks it into a hash
public
handle(string $styles) : array<string|int, mixed>
Parameters
- $styles : string