Attention
TYPO3 v10 has reached end-of-life as of April 30th 2023 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
uri.resource¶
A ViewHelper for creating URIs to resources.
Examples¶
Defaults¶
<link href="{f:uri.resource(path:'css/stylesheet.css')}" rel="stylesheet" />
Output:
<link href="typo3conf/ext/example_extension/Resources/Public/css/stylesheet.css" rel="stylesheet" />
Depending on current extension.
With extension name¶
<link href="{f:uri.resource(path:'css/stylesheet.css', extensionName: 'AnotherExtension')}" rel="stylesheet" />
Output:
<link href="typo3conf/ext/another_extension/Resources/Public/css/stylesheet.css" rel="stylesheet" />
Arguments¶
path¶
- DataType
string
- Required
true
- Description
The path and filename of the resource (relative to Public resource directory of the extension).
extensionName¶
- DataType
string
- Required
false
- Description
Target extension name. If not set, the current extension name will be used
absolute¶
- DataType
mixed
- Required
false
- Description
If set, an absolute URI is rendered