CssViewHelper extends AbstractTagBasedViewHelper
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:asset.css>
ViewHelper to add CSS to the TYPO3 AssetCollector. Either a file or inline CSS can be added.
Examples
::
<f:asset.css identifier="identifier123" href="EXT:my_ext/Resources/Public/Css/foo.css" /> <f:asset.css identifier="identifier123"> .foo { color: black; } </f:asset.css>
Details
In the AssetCollector, the "identifier" attribute is used as a unique identifier. Thus, if assets are added multiple times using the same identifier, the asset will only be served once (the last added overrides previous assets).
Some available attributes are defaults but do not make sense for this ViewHelper. Relevant attributes specific for this ViewHelper are: as, crossorigin, disabled, href, hreflang, importance, integrity, media, referrerpolicy, sizes, type, nonce.
Using the "inline" argument, the file content of the referenced file is added as inline style.
Table of Contents
Properties
- $assetCollector : AssetCollector
- $escapeChildren : bool
- Rendered children string is passed as CSS code, there is no point in HTML encoding anything from that.
- $escapeOutput : bool
- This VH does not produce direct output, thus does not need to be wrapped in an escaping node
Methods
- initialize() : void
- initializeArguments() : void
- injectAssetCollector() : void
- render() : string
Properties
$assetCollector
protected
AssetCollector
$assetCollector
$escapeChildren
Rendered children string is passed as CSS code, there is no point in HTML encoding anything from that.
protected
bool
$escapeChildren
= true
$escapeOutput
This VH does not produce direct output, thus does not need to be wrapped in an escaping node
protected
bool
$escapeOutput
= false
Methods
initialize()
public
initialize() : void
initializeArguments()
public
initializeArguments() : void
injectAssetCollector()
public
injectAssetCollector(AssetCollector $assetCollector) : void
Parameters
- $assetCollector : AssetCollector
render()
public
render() : string