class StaticResourceHelper implements ProtectedContextAwareInterface (View source)

Properties

protected ResourceManager $resourceManager
protected Service $i18nService

Methods

string
uri(string $packageKey, string $pathAndFilename, bool $localize = false)

Get the public uri of a package resource

string
content(string $packageKey, string $pathAndFilename, bool $localize = false)

Get the content of a package resource

string
getLocalizedResourcePath(string $packageKey, string $pathAndFilename, bool $localize = false)

Get a resource://.. url for the given arguments and apply localization if needed

bool
allowsCallOfMethod(string $methodName)

No description

Details

string uri(string $packageKey, string $pathAndFilename, bool $localize = false)

Get the public uri of a package resource

Parameters

string $packageKey

Package key where the resource is from.

string $pathAndFilename

The path and filename of the resource. Has to start with "Public/..." as private resources do not have a uri.

bool $localize

If enabled localizing of the resource is attempted by adding locales from the current locale-chain between filename and extension.

Return Value

string

string content(string $packageKey, string $pathAndFilename, bool $localize = false)

Get the content of a package resource

Parameters

string $packageKey

Package key where the resource is from.

string $pathAndFilename

The path and filename of the resource. Starting with "Public/..." or "Private/..."

bool $localize

If enabled localizing of the resource is attempted by adding locales from the current locale-chain between filename and extension.

Return Value

string

protected string getLocalizedResourcePath(string $packageKey, string $pathAndFilename, bool $localize = false)

Get a resource://.. url for the given arguments and apply localization if needed

Parameters

string $packageKey
string $pathAndFilename
bool $localize

Return Value

string

bool allowsCallOfMethod(string $methodName)

No description

Parameters

string $methodName

Return Value

bool