SystemResourceFactory

Read onlyYes

This is the heart of system resource handling and the most important API to be used in userland code and throughout the core.

This class should be final, but is not, because it needs to be mocked in tests.

Attributes
#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
createPublicResource()  : PublicResourceInterface
Use this method to obtain a resource that is public, which means, that a URI can be generated for it.
createResource()  : StaticResourceInterface
Use this method, when generating a URI is not required for the resource and only e.g. file contents like for templates is required.

Methods

createPublicResource()

Use this method to obtain a resource that is public, which means, that a URI can be generated for it.

public createPublicResource(string $resourceString) : PublicResourceInterface

Always use it when the goal is to generate a URI, as it checks, whether the resolved resource can/ is indeed published or not and throws an exception otherwise.

Parameters
$resourceString : string
Tags
throws
CanNotResolveSystemResourceException
throws
CanNotResolvePublicResourceException
Return values
PublicResourceInterface

        
On this page

Search results