\Piko\AssetBundle

AssetBundle represents a collection of CSS files and JS files to publish inside the public path.

Properties summary

Name Description
public $css List of CSS files that this bundle contains.
public $dependencies Bundle dependencies.
public $js List of JavaScript files that this bundle contains…
public $jsPosition Position of the js file in the generated view.
public $name The bundle name. (eg. jquery, bootstrap, etc.)
public $publishedBasePath The root directory storing the published asset fil…
public $publishedBaseUrl The base URL through which the published asset fil…
public $sourcePath The directory that contains the source asset files…
protected $assetBundles list of the registered asset bundles. The keys are…

Inherited Properties

Name Description
protected $eventDispatcher  
protected $listenerProvider  

Methods summary

Name Description
public publish Publish assets into public path
public register Registers this asset bundle with a view.
protected copy Copy recursively a folder into another one.

Inherited Methods

Name Description
public on  
public trigger Trigger an event that may be listen by event liste…

Properties

public $css : string[]

List of CSS files that this bundle contains.

public $dependencies : string[]

Bundle dependencies.

public $js : string[]

List of JavaScript files that this bundle contains.

public $jsPosition : int

Position of the js file in the generated view.

see \Piko\View

public $name : string

The bundle name. (eg. jquery, bootstrap, etc.)

public $publishedBasePath : string

The root directory storing the published asset files.

public $publishedBaseUrl : string

The base URL through which the published asset files can be accessed.

public $sourcePath : string

The directory that contains the source asset files for this asset bundle. You can use either a directory or an alias of the directory.

protected $assetBundles : \Piko\AssetBundle[]

list of the registered asset bundles. The keys are the bundle names and the values are the AssetBundle class name.

see \Piko\AssetBundle::register()


Methods

public publish(): void

public  publish(): void

Publish assets into public path


public register(): \Piko\AssetBundle

public static  register(\Piko\View  $view): \Piko\AssetBundle

Registers this asset bundle with a view.

Parameters

$view : the view to be registered with

Return:

\Piko\AssetBundle the registered asset bundle instance


protected copy(): void

protected  copy(string  $src, string  $dest): void

Copy recursively a folder into another one.

Parameters

$src : The source directory to copy

$dest : The destination directory to copy

throws \RuntimeExceptionif src not exists