Свойство | Type | Description | |
---|---|---|---|
$asset_regex | string | Regex to match against a filename/url to determine if it is an asset. | |
$collections | array | Each collection is an array of assets. Collections may also contain other collections. | |
$css | array | Not accepted as an option of config() method. | |
$css_dir | string | Relative to your public directory ('public_dir'). No trailing slash!. | |
$css_minifier | Closure | Closure used by the pipeline to minify CSS assets. | |
$css_regex | string | Regex to match against a filename/url to determine if it is a CSS asset. | |
$fetch_command | Closure | Useful when file_get_contents() function is not available in your PHP instalation or when you want to apply any kind of preprocessing to your assets before they get pipelined. The closure will receive as the only parameter a string with the path/URL of the asset and it should return the content of the asset file as a string. | |
$js | array | Not accepted as an option of config() method. | |
$js_dir | string | Relative to your public directory ('public_dir'). No trailing slash!. | |
$js_minifier | Closure | Closure used by the pipeline to minify JavaScript assets. | |
$js_regex | string | Regex to match against a filename/url to determine if it is a JavaScript asset. | |
$no_minification_regex | string | Regex to match against a filename/url to determine if it should not be minified by pipeline. | |
$notify_command | Closure | Useful if you need to hook to the pipeline event for things such syncing your pipelined assets with an external server or CDN. The closure will receive five parameters: - String containing the name of the file that has been created. - String containing the relative URL of the file. - String containing the absolute path (filesystem) of the file. - Array containing the assets included in the file. - Boolean indicating whether or not a gziped version of the file was also created. | |
$packages_dir | string | Relative to your public directory ('public_dir'). No trailing slash!. | |
$pipeline | boolean | string | Use a string that evaluates to true to provide the salt of the pipeline hash. Use 'auto' to automatically calculated the salt from your assets last modification time. | |
$pipeline_dir | string | Relative to your assets directories ('css_dir' and 'js_dir'). No trailing slash!. | |
$pipeline_gzip | boolean | integer | Useful only if your webserver supports Gzip HTTP_ACCEPT_ENCODING. Set to true to use the default compression level. Set an integer between 0 (no compression) and 9 (maximum compression) to choose compression level. | |
$public_dir | string | Required if you enable the pipeline. No trailing slash!. |
Méthode | Description | |
---|---|---|
__construct ( array $options = [] ) : void | Class constructor. | |
add ( mixed $asset ) : |
Add an asset or a collection of assets. | |
addCss ( mixed $asset ) : |
Add a CSS asset. | |
addDir ( string $directory, string $pattern = null ) : |
Add all assets matching $pattern within $directory. | |
addDirCss ( string $directory ) : |
Add all CSS assets within $directory (relative to public dir). | |
addDirJs ( string $directory ) : |
Add all JavaScript assets within $directory (relative to public dir). | |
addJs ( mixed $asset ) : |
Add a JavaScript asset. | |
buildTagAttributes ( array $attributes ) : string | Build an HTML attribute string from an array. | |
config ( array $config ) : |
Set up configuration options. | |
css ( array | Closur\Closure $attributes = null ) : string | Build the CSS tags. | |
getCss ( ) : array | Get all CSS assets already added. | |
getJs ( ) : array | Get all JavaScript assets already added. | |
js ( array | Closur\Closure $attributes = null ) : string | Build the JavaScript tags. | |
registerCollection ( string $collectionName, array $assets ) : |
Add/replace collection. | |
reset ( ) : |
Reset all assets. | |
resetCss ( ) : |
Reset CSS assets. | |
resetJs ( ) : |
Reset JavaScript assets. |
Méthode | Description | |
---|---|---|
assetIsFromPackage ( string $asset ) : boolean | array | Determine whether an asset is normal or from a package. | |
buildLocalLink ( string $asset, string $dir ) : string | Build link to local asset. | |
calculatePipelineHash ( array $assets ) : string | Calculate the pipeline hash. | |
cssPipeline ( ) : string | Minifiy and concatenate CSS files. | |
isRemoteLink ( string $link ) : boolean | Determine whether a link is local or remote. | |
jsPipeline ( ) : string | Minifiy and concatenate JavaScript files. | |
packLinks ( array $links, Closure $minifier ) : string | Download, concatenate and minifiy the content of several links. | |
pipeline ( array $assets, string $extension, string $subdirectory, Closure $minifier ) : string | Minifiy and concatenate files. | |
rglob ( string $directory, string $pattern, string $ltrim = null ) : array | Recursively get files matching $pattern within $directory. |
public __construct ( array $options = [] ) : void | ||
$options | array | See config() method for details. |
Résultat | void |
public buildTagAttributes ( array $attributes ) : string | ||
$attributes | array | |
Résultat | string |
protected calculatePipelineHash ( array $assets ) : string | ||
$assets | array | |
Résultat | string |
protected cssPipeline ( ) : string | ||
Résultat | string |
protected isRemoteLink ( string $link ) : boolean | ||
$link | string | |
Résultat | boolean |
protected jsPipeline ( ) : string | ||
Résultat | string |
public registerCollection ( string $collectionName, array $assets ) : |
||
$collectionName | string | |
$assets | array | |
Résultat |
protected string $asset_regex | ||
Résultat | string |
protected array $collections | ||
Résultat | array |
protected array $css | ||
Résultat | array |
protected string $css_dir | ||
Résultat | string |
protected Closure $css_minifier | ||
Résultat | Closure |
protected string $css_regex | ||
Résultat | string |
protected Closure $fetch_command | ||
Résultat | Closure |
protected array $js | ||
Résultat | array |
protected string $js_dir | ||
Résultat | string |
protected Closure $js_minifier | ||
Résultat | Closure |
protected string $js_regex | ||
Résultat | string |
protected string $no_minification_regex | ||
Résultat | string |
protected Closure $notify_command | ||
Résultat | Closure |
protected string $packages_dir | ||
Résultat | string |
protected string $pipeline_dir | ||
Résultat | string |
protected string $public_dir | ||
Résultat | string |