ResourceInterceptor
class ResourceInterceptor implements InterceptorInterface (View source)
This interceptor looks for URIs pointing to package resources and in place of those adds ResourceUriNode instances using the ResourceViewHelper to make those URIs work in the rendered template.
That means you can build your template so that it can be previewed as is and pointers to CSS, JS, images, ... will still work when the resources are mirrored by Flow.
Currently the supported URIs are of the form
[../]Public/Some/<Path/To/Resource> (will use current package)
[../]
Constants
PATTERN_SPLIT_AT_RESOURCE_URIS |
Split a text at what seems to be a package resource URI. |
PATTERN_MATCH_RESOURCE_URI |
Is the text at hand a resource URI and what are path/package? |
Properties
protected string | $defaultPackageKey | The default package key to use when rendering resource links without a package key in the source URL. |
Methods
Set the default package key to use for resource URIs.
Looks for URIs pointing to package resources and in place of those adds ViewHelperNode instances using the ResourceViewHelper.
This interceptor wants to hook into text nodes.
Details
void
setDefaultPackageKey(string $defaultPackageKey)
Set the default package key to use for resource URIs.
NodeInterface
process(NodeInterface $node, int $interceptorPosition, ParsingState $parsingState)
Looks for URIs pointing to package resources and in place of those adds ViewHelperNode instances using the ResourceViewHelper.
array
getInterceptionPoints()
This interceptor wants to hook into text nodes.