Methods summary
public
|
#
__construct( string $name )
Create a new asset container instance.
Create a new asset container instance.
Parameters
|
public
Laravel\Asset_Container
|
#
add( string $name, string $source, array $dependencies = array(), array $attributes = array() )
Add an asset to the container.
Add an asset to the container.
The extension of the asset source will be used to determine the type of asset
being registered (CSS or JavaScript). When using a non-standard extension, the
style/script methods may be used to register assets.
Asset::container()->add('jquery', 'js/jquery.js');
Asset::add('jquery', 'js/jquery.js', 'jquery-ui');
Asset::add('jquery', 'js/jquery.js', null, array('defer'));
Parameters
- $name
string $name
- $source
string $source
- $dependencies
array $dependencies
- $attributes
array $attributes
Returns
|
public
Laravel\Asset_Container
|
#
style( string $name, string $source, array $dependencies = array(), array $attributes = array() )
Add a CSS file to the registered assets.
Add a CSS file to the registered assets.
Parameters
- $name
string $name
- $source
string $source
- $dependencies
array $dependencies
- $attributes
array $attributes
Returns
|
public
Laravel\Asset_Container
|
#
script( string $name, string $source, array $dependencies = array(), array $attributes = array() )
Add a JavaScript file to the registered assets.
Add a JavaScript file to the registered assets.
Parameters
- $name
string $name
- $source
string $source
- $dependencies
array $dependencies
- $attributes
array $attributes
Returns
|
public
string
|
#
path( string $source )
Returns the full-path for an asset.
Returns the full-path for an asset.
Parameters
Returns
string
|
public
Laravel\Asset_Container
|
#
bundle( string $bundle )
Set the bundle that the container's assets belong to.
Set the bundle that the container's assets belong to.
Parameters
Returns
|
protected
|
#
register( string $type, string $name, string $source, array $dependencies, array $attributes )
Add an asset to the array of registered assets.
Add an asset to the array of registered assets.
Parameters
- $type
string $type
- $name
string $name
- $source
string $source
- $dependencies
array $dependencies
- $attributes
array $attributes
|
public
string
|
#
styles( )
Get the links to all of the registered CSS assets.
Get the links to all of the registered CSS assets.
Returns
string
|
public
string
|
#
scripts( )
Get the links to all of the registered JavaScript assets.
Get the links to all of the registered JavaScript assets.
Returns
string
|
protected
string
|
#
group( string $group )
Get all of the registered assets for a given type / group.
Get all of the registered assets for a given type / group.
Parameters
Returns
string
|
protected
string
|
#
asset( string $group, string $name )
Get the HTML link to a registered asset.
Get the HTML link to a registered asset.
Parameters
- $group
string $group
- $name
string $name
Returns
string
|
protected
array
|
#
arrange( array $assets )
Sort and retrieve assets based on their dependencies
Sort and retrieve assets based on their dependencies
Parameters
Returns
array
|
protected
|
#
evaluate_asset( string $asset, string $value, array $original, array & $sorted, array & $assets )
Evaluate an asset and its dependencies.
Evaluate an asset and its dependencies.
Parameters
- $asset
string $asset
- $value
string $value
- $original
array $original
- $sorted
array $sorted
- $assets
array $assets
|
protected
boolean
|
#
dependency_is_valid( string $asset, string $dependency, array $original, array $assets )
Verify that an asset's dependency is valid.
Verify that an asset's dependency is valid.
A dependency is considered valid if it exists, is not a circular reference,
and is not a reference to the owning asset itself. If the dependency doesn't
exist, no error or warning will be given. For the other cases, an exception is
thrown.
Parameters
- $asset
string $asset
- $dependency
string $dependency
- $original
array $original
- $assets
array $assets
Returns
boolean
|