class SimpleResourceURLGenerator implements ResourceURLGenerator (View source)

Generate URLs assuming that BASE_PATH is also the webroot Standard SilverStripe 3 operation

Properties

static private array $url_rewrites

Rewrites applied after generating url.

Methods

getNonceStyle()

No description

setNonceStyle($nonceStyle)

No description

string
urlForResource(string|ModuleResource $relativePath)

Return the URL for a resource, prefixing with Director::baseURL() and suffixing with a nonce

Details

getNonceStyle()

setNonceStyle($nonceStyle)

Parameters

$nonceStyle

string urlForResource(string|ModuleResource $relativePath)

Return the URL for a resource, prefixing with Director::baseURL() and suffixing with a nonce

Parameters

string|ModuleResource $relativePath

File or directory path relative to BASE_PATH

Return Value

string

URL, either domain-relative (starting with /) or absolute

Exceptions

InvalidArgumentException

If the resource doesn't exist