Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
AssetsManager Class Reference

Assets manager for css and js inclusions in templates. More...

Static Public Member Functions

static start (&$config)
 Starts the assets manager.
 
static setAssetsFolder ($assetsFolder='/assets/')
 
static getUrl ($resource, $absolute=false)
 Returns the absolute or relative url to the resource.
 
static getActiveThemeUrl ($resource, $absolute=false)
 Returns the absolute or relative url for a resource in the activeTheme.
 
static getThemeUrl ($theme, $resource, $absolute=false)
 Returns the absolute or relative url for a resource in a theme.
 
static js ($resource, $attributes=[], $absolute=false)
 Returns the script inclusion for a javascript resource.
 
static css ($resource, $attributes=[], $absolute=false)
 Returns the css inclusion for a stylesheet resource.
 
static img ($src, $attributes=[], $absolute=false)
 Returns the image tag for inclusion.
 
static js_ ($resource, $attributes=[], $absolute=false)
 Returns the script inclusion for a javascript resource in activeTheme.
 
static css_ ($resource, $attributes=[], $absolute=false)
 Returns the css inclusion for a stylesheet resource in activeTheme.
 
static img_ ($src, $attributes=[], $absolute=false)
 Returns the image tag for inclusion in activeTheme.
 

Static Private Member Functions

static gString ($template, $variable, $attributes=[])
 
static script ($src, $attributes=[])
 
static stylesheet ($link, $attributes=[])
 
static image ($src, $attributes=[])
 

Static Private Attributes

static $assetsFolder = '/assets/'
 
static $siteURL
 

Detailed Description

Assets manager for css and js inclusions in templates.

Ubiquity\assets$AssetsManager This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.3
Since
Ubiquity 2.1.0

Definition at line 21 of file AssetsManager.php.

Member Function Documentation

◆ css()

static css (   $resource,
  $attributes = [],
  $absolute = false 
)
static

Returns the css inclusion for a stylesheet resource.

Parameters
string$resourceThe css resource to include
array$attributesThe other html attributes of the script element
boolean$absoluteTrue if url must be absolute (containing siteUrl)
Returns
string

Definition at line 123 of file AssetsManager.php.

◆ css_()

static css_ (   $resource,
  $attributes = [],
  $absolute = false 
)
static

Returns the css inclusion for a stylesheet resource in activeTheme.

Parameters
string$resourceThe css resource to include
array$attributesThe other html attributes of the script element
boolean$absoluteTrue if url must be absolute (containing siteUrl)
Returns
string

Definition at line 159 of file AssetsManager.php.

◆ getActiveThemeUrl()

static getActiveThemeUrl (   $resource,
  $absolute = false 
)
static

Returns the absolute or relative url for a resource in the activeTheme.

Parameters
string$resource
boolean$absolute
Returns
string

Definition at line 83 of file AssetsManager.php.

◆ getThemeUrl()

static getThemeUrl (   $theme,
  $resource,
  $absolute = false 
)
static

Returns the absolute or relative url for a resource in a theme.

Parameters
string$theme
string$resource
boolean$absolute
Returns
string

Definition at line 96 of file AssetsManager.php.

◆ getUrl()

static getUrl (   $resource,
  $absolute = false 
)
static

Returns the absolute or relative url to the resource.

Parameters
string$resource
boolean$absolute
Returns
string

Definition at line 66 of file AssetsManager.php.

◆ gString()

static gString (   $template,
  $variable,
  $attributes = [] 
)
staticprivate

Definition at line 25 of file AssetsManager.php.

◆ image()

static image (   $src,
  $attributes = [] 
)
staticprivate

Definition at line 39 of file AssetsManager.php.

◆ img()

static img (   $src,
  $attributes = [],
  $absolute = false 
)
static

Returns the image tag for inclusion.

Parameters
string$srcThe base path to the image
array$attributesThe other html attributes of the image element
boolean$absoluteTrue if url must be absolute (containing siteUrl)
Returns
string

Definition at line 135 of file AssetsManager.php.

◆ img_()

static img_ (   $src,
  $attributes = [],
  $absolute = false 
)
static

Returns the image tag for inclusion in activeTheme.

Parameters
string$srcThe base path to the image
array$attributesThe other html attributes of the image element
boolean$absoluteTrue if url must be absolute (containing siteUrl)
Returns
string

Definition at line 171 of file AssetsManager.php.

◆ js()

static js (   $resource,
  $attributes = [],
  $absolute = false 
)
static

Returns the script inclusion for a javascript resource.

Parameters
string$resourceThe javascript resource to include
array$attributesThe other html attributes of the script element
boolean$absoluteTrue if url must be absolute (containing siteUrl)
Returns
string

Definition at line 111 of file AssetsManager.php.

◆ js_()

static js_ (   $resource,
  $attributes = [],
  $absolute = false 
)
static

Returns the script inclusion for a javascript resource in activeTheme.

Parameters
string$resourceThe javascript resource to include
array$attributesThe other html attributes of the script element
boolean$absoluteTrue if url must be absolute (containing siteUrl)
Returns
string

Definition at line 147 of file AssetsManager.php.

◆ script()

static script (   $src,
  $attributes = [] 
)
staticprivate

Definition at line 30 of file AssetsManager.php.

◆ setAssetsFolder()

static setAssetsFolder (   $assetsFolder = '/assets/')
static

Definition at line 55 of file AssetsManager.php.

◆ start()

static start ( $config)
static

Starts the assets manager.

Essential to define the siteURL part

Parameters
array$config

Definition at line 50 of file AssetsManager.php.

◆ stylesheet()

static stylesheet (   $link,
  $attributes = [] 
)
staticprivate

Definition at line 34 of file AssetsManager.php.

Field Documentation

◆ $assetsFolder

$assetsFolder = '/assets/'
staticprivate

Definition at line 22 of file AssetsManager.php.

◆ $siteURL

$siteURL
staticprivate

Definition at line 23 of file AssetsManager.php.


The documentation for this class was generated from the following file: