Class Socialveo\Core\library\AssetManager

InheritanceSocialveo\Core\library\AssetManager » Phalcon\Assets\Manager
Uses TraitsSocialveo\Core\Translatable

Class AssetManager

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() AssetManager constructor. Socialveo\Core\library\AssetManager
_t() Gets translations Socialveo\Core\Translatable
addBundle() Adds asset bundle $assets->addBundle('bootstrap'); $assets->addBundle('jquery', ['join' => false]); $assets->addBundle('bootstrap-fileinput', ['locale' => 'ru']); $assets->addBundle('social-likes', ['theme' => 'flat']); $assets->addBundle('jcf', ['modules' => ['button', 'checkbox', 'range']]); Socialveo\Core\library\AssetManager
addDependencies() Add dependencies to bundle with name $bundle in the asset-bundles. Socialveo\Core\library\AssetManager
outputCss() Prints the HTML for CSS resources Socialveo\Core\library\AssetManager
outputJs() Prints the HTML for JS resources Socialveo\Core\library\AssetManager
removeDependencies() Remove dependencies from bundle with name $bundle in the asset-bundles. Socialveo\Core\library\AssetManager
setBundles() Add bundles to asset-bundles. Socialveo\Core\library\AssetManager
setDependencies() Reset current dependencies and set new to bundle in the asset-bundles. Socialveo\Core\library\AssetManager
t() Gets translations Socialveo\Core\Translatable

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
add() Add resource by type Socialveo\Core\library\AssetManager
addFile() Add file to bundle Socialveo\Core\library\AssetManager
getAsType() Gets array option with established data type. Socialveo\Core\library\AssetManager
getCollection() Gets collection by resource type Socialveo\Core\library\AssetManager
getOption() Get the option's value Socialveo\Core\library\AssetManager

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
POSITION_BOTTOM 'bottom' Socialveo\Core\library\AssetManager
POSITION_NORMAL 'normal' Socialveo\Core\library\AssetManager
POSITION_TOP 'top' Socialveo\Core\library\AssetManager

Property Details

$_assetsPath protected property
protected string $_assetsPath null
$_baseDir protected property
protected string $_baseDir null
$_bundle_collections protected property
$_bundles protected property
protected array $_bundles = []
$_bundlesCache protected property
protected array $_bundlesCache = []
$_cacheBasteParam protected property
protected string $_cacheBasteParam null
$_cdn protected property
protected array $_cdn = ['css' => [], 'js' => []]
$_cssCollection protected property
protected string $_cssCollection '__cssAssetBundle'
$_jsCollection protected property
protected string $_jsCollection '__jsAssetBundle'
$_minify protected property
protected boolean $_minify true
$_overwrite protected property
protected boolean $_overwrite false
$_prefix protected property
protected string $_prefix null
$_require protected property
$_resources protected property
protected array[] $_resources = ['css' => [], 'js' => []]
$_targetDir protected property
protected string $_targetDir 'concat'

Method Details

__construct() public method

AssetManager constructor.

public void __construct ( $options null )
$options array|null
throws ErrorException
add() protected method

Add resource by type

protected void add ( $type, $uri )
$type string

Resource type

$uri string

Resource uri

addBundle() public method

Adds asset bundle $assets->addBundle('bootstrap'); $assets->addBundle('jquery', ['join' => false]); $assets->addBundle('bootstrap-fileinput', ['locale' => 'ru']); $assets->addBundle('social-likes', ['theme' => 'flat']); $assets->addBundle('jcf', ['modules' => ['button', 'checkbox', 'range']]);

public Socialveo\Core\library\AssetManager addBundle ( $name, $options = [] )
$name string|array
$options array

[optional]

throws ErrorException
addDependencies() public static method

Add dependencies to bundle with name $bundle in the asset-bundles.

public static array addDependencies ( &$bundles, $bundle, array $dependencies )
$bundles array
$bundle string
$dependencies array
addFile() protected method

Add file to bundle

protected void addFile ( $type, $join, $cdn, $position, $baseDir, $path, $file )
$type string
$join boolean
$cdn boolean
$position string
$baseDir string
$path string
$file string
getAsType() protected method

Gets array option with established data type.

Throws error on failure

protected mixed getAsType ( $bundle, $options, $name, $type )
$bundle string
$options array
$name string
$type string
throws ErrorException
getCollection() protected method

Gets collection by resource type

protected Phalcon\Assets\Collection|Socialveo\Core\library\AssetManager getCollection ( $type, &$name null )
$type string
$name string

[optional]

getOption() protected method

Get the option's value

protected mixed getOption ( &$options, $name, $remove_option true )
$options array
$name string
$remove_option boolean
outputCss() public method

Prints the HTML for CSS resources

public void outputCss ( $collectionName null )
$collectionName string
outputJs() public method

Prints the HTML for JS resources

public void outputJs ( $collectionName null )
$collectionName string
removeDependencies() public static method

Remove dependencies from bundle with name $bundle in the asset-bundles.

public static array removeDependencies ( &$bundles, $bundle, array $dependencies )
$bundles array
$bundle string
$dependencies array
setBundles() public static method

Add bundles to asset-bundles.

public static array setBundles ( &$bundles, $addBundles )
$bundles array
$addBundles array
setDependencies() public static method

Reset current dependencies and set new to bundle in the asset-bundles.

public static array setDependencies ( &$bundles, $bundle, array $dependencies )
$bundles array
$bundle string
$dependencies array