Attention

TYPO3 v9 has reached its end-of-life September 30th, 2021 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.

You can order Extended Long Term Support (ELTS) 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/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/Resources/Public/css/stylesheet.css" rel="stylesheet" />

Arguments

path

DataType

string

Required

false

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