Assets
in package

This is the Assets class.

Remember that assets refer to all the static content (css,img,js,...) that makes up the project.
The purpose of this class is to facilitate the assets paths.

Tags
see
Assets::getInstance()
see
Assets::getAssetsPaths()
see
Assets::getAssetsPath()

Table of Contents

ASSETS_FILE  = '/assets.json'
ENVIRONMENT_COMMERCE  = 'commerce'
ENVIRONMENT_CORE  = 'core'
ENVIRONMENT_CUSTOMIZED  = 'customized'
ENVIRONMENT_IMAGES  = 'images'
ENVIRONMENT_PLUGINS  = 'plugins'
ENVIRONMENT_THEMES  = 'themes'
ENVIRONMENT_THEMES_VERSIONS  = 'versions'
TYPE_CSS  = 'css'
TYPE_FONT  = 'fonts'
TYPE_IMG  = 'img'
TYPE_JS  = 'js'
getAssetsFontsPath() This method returns the assets fonts path for the given environment.  : string
getAssetsImagesPath() This method returns the assets images path for the given environment.  : string
getAssetsPath() This method returns the assets path for the given environment.  : string
getAssetsPaths() This method returns the assets paths for the given environment, type and group.  : array<string|int, mixed>
getInstance() This method returns the Assets instance (singleton)  : Assets

Constants

ASSETS_FILE

public mixed ASSETS_FILE = '/assets.json'

ENVIRONMENT_COMMERCE

public mixed ENVIRONMENT_COMMERCE = 'commerce'

ENVIRONMENT_CORE

public mixed ENVIRONMENT_CORE = 'core'

ENVIRONMENT_CUSTOMIZED

public mixed ENVIRONMENT_CUSTOMIZED = 'customized'

ENVIRONMENT_IMAGES

public mixed ENVIRONMENT_IMAGES = 'images'

ENVIRONMENT_PLUGINS

public mixed ENVIRONMENT_PLUGINS = 'plugins'

ENVIRONMENT_THEMES

public mixed ENVIRONMENT_THEMES = 'themes'

ENVIRONMENT_THEMES_VERSIONS

public mixed ENVIRONMENT_THEMES_VERSIONS = 'versions'

TYPE_CSS

public mixed TYPE_CSS = 'css'

TYPE_FONT

public mixed TYPE_FONT = 'fonts'

TYPE_IMG

public mixed TYPE_IMG = 'img'

TYPE_JS

public mixed TYPE_JS = 'js'

Methods

getAssetsFontsPath()

This method returns the assets fonts path for the given environment.

public getAssetsFontsPath(string $environment) : string
Parameters
$environment : string

Possible values: one of these Assets constants: ENVIRONMENT_CORE, ENVIRONMENT_COMMERCE, ENVIRONMENT_THEMES, ENVIRONMENT_THEMES_VERSIONS, ENVIRONMENT_CUSTOMIZED.

Return values
string

getAssetsImagesPath()

This method returns the assets images path for the given environment.

public getAssetsImagesPath(string $environment) : string
Parameters
$environment : string

Possible values: one of these Assets constants: ENVIRONMENT_CORE, ENVIRONMENT_COMMERCE, ENVIRONMENT_THEMES, ENVIRONMENT_THEMES_VERSIONS, ENVIRONMENT_CUSTOMIZED, ENVIRONMENT_IMAGES

Return values
string

getAssetsPath()

This method returns the assets path for the given environment.

public getAssetsPath(string $environment) : string
Parameters
$environment : string

Possible values: one of these Assets constants: ENVIRONMENT_CORE, ENVIRONMENT_COMMERCE, ENVIRONMENT_THEMES, ENVIRONMENT_THEMES_VERSIONS, ENVIRONMENT_CUSTOMIZED.

Return values
string

getAssetsPaths()

This method returns the assets paths for the given environment, type and group.

public getAssetsPaths(string $environment, string $type, string $group) : array<string|int, mixed>
Parameters
$environment : string

Possible values: one of these Assets constants: ENVIRONMENT_CORE, ENVIRONMENT_COMMERCE, ENVIRONMENT_THEMES, ENVIRONMENT_THEMES_VERSIONS, ENVIRONMENT_CUSTOMIZED.

$type : string

Possible values: one of these Assets constants: TYPE_CSS, TYPE_JS, TYPE_IMG, TYPE_FONT.

$group : string
Return values
array<string|int, mixed>

getInstance()

This method returns the Assets instance (singleton)

public final static getInstance() : Assets
Return values
Assets

Search results