class Packages extends Packages (View source)

Class Packages

Constants

ABSOLUTE

Absolute package is for reaching resources at server root.

DOCUMENTS

Document package is for reaching files with relative path to server root.

ABSOLUTE_DOCUMENTS

Document package is for reaching files with absolute url with domain-name.

PUBLIC_PATH

Public path package is for internally reaching public files with absolute path.

Be careful, this provides server paths.

PRIVATE_PATH

Private path package is for internally reaching private files with absolute path.

Be careful, this provides server paths.

FONTS_PATH

Fonts path package is for internally reaching font files with absolute path.

Be careful, this provides server paths.

Methods

__construct(VersionStrategyInterface $versionStrategy, RequestStack $requestStack, FileAwareInterface $fileAware, string $staticDomain = "", bool $isPreview = false)

Build a new asset packages for Roadiz root and documents.

bool
useStaticDomain()

No description

string
getStaticDomainAndPort()

No description

PathPackage|UrlPackage
getDefaultPackage()

No description

PathPackage|UrlPackage
getAbsoluteDefaultPackage()

No description

PathPackage|UrlPackage
getDocumentPackage()

No description

PathPackage|UrlPackage
getAbsoluteDocumentPackage()

No description

PathPackage
getPublicPathPackage()

No description

PathPackage
getPrivatePathPackage()

No description

PathPackage
getFontsPathPackage()

No description

string
getFontsPath($relativePath)

Shortcut for $this->getUrl($relativePath, static::FONTS_PATH).

string
getPublicFilesPath($relativePath)

Shortcut for $this->getUrl($relativePath, static::PUBLIC_PATH).

string
getPrivateFilesPath($relativePath)

Shortcut for $this->getUrl($relativePath, static::PRIVATE_PATH).

string
getDocumentFilePath(Document $document)

No description

string
getDocumentFolderPath(Document $document)

No description

string
getStaticDomain()

No description

setStaticDomain(string $staticDomain)

No description

Details

__construct(VersionStrategyInterface $versionStrategy, RequestStack $requestStack, FileAwareInterface $fileAware, string $staticDomain = "", bool $isPreview = false)

Build a new asset packages for Roadiz root and documents.

Parameters

VersionStrategyInterface $versionStrategy
RequestStack $requestStack
FileAwareInterface $fileAware
string $staticDomain
bool $isPreview

bool useStaticDomain()

Return Value

bool

protected string getStaticDomainAndPort()

Return Value

string

protected PathPackage|UrlPackage getDefaultPackage()

Return Value

PathPackage|UrlPackage

protected PathPackage|UrlPackage getAbsoluteDefaultPackage()

Return Value

PathPackage|UrlPackage

protected PathPackage|UrlPackage getDocumentPackage()

Return Value

PathPackage|UrlPackage

protected PathPackage|UrlPackage getAbsoluteDocumentPackage()

Return Value

PathPackage|UrlPackage

protected PathPackage getPublicPathPackage()

Return Value

PathPackage

protected PathPackage getPrivatePathPackage()

Return Value

PathPackage

protected PathPackage getFontsPathPackage()

Return Value

PathPackage

string getFontsPath($relativePath)

Shortcut for $this->getUrl($relativePath, static::FONTS_PATH).

Parameters

$relativePath

Return Value

string

string getPublicFilesPath($relativePath)

Shortcut for $this->getUrl($relativePath, static::PUBLIC_PATH).

Parameters

$relativePath

Return Value

string

string getPrivateFilesPath($relativePath)

Shortcut for $this->getUrl($relativePath, static::PRIVATE_PATH).

Parameters

$relativePath

Return Value

string

string getDocumentFilePath(Document $document)

Parameters

Document $document

Return Value

string Document file absolute path according if document is private or not.

string getDocumentFolderPath(Document $document)

Parameters

Document $document

Return Value

string Document folder absolute path according if document is private or not.

string getStaticDomain()

Return Value

string

Packages setStaticDomain(string $staticDomain)

Parameters

string $staticDomain

Return Value

Packages