PHP Класс Stolz\Assets\Manager

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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!.

Открытые методы

Метод Описание
__construct ( array $options = [] ) : void Class constructor.
add ( mixed $asset ) : Manager Add an asset or a collection of assets.
addCss ( mixed $asset ) : Manager Add a CSS asset.
addDir ( string $directory, string $pattern = null ) : Manager Add all assets matching $pattern within $directory.
addDirCss ( string $directory ) : Manager Add all CSS assets within $directory (relative to public dir).
addDirJs ( string $directory ) : Manager Add all JavaScript assets within $directory (relative to public dir).
addJs ( mixed $asset ) : Manager Add a JavaScript asset.
buildTagAttributes ( array $attributes ) : string Build an HTML attribute string from an array.
config ( array $config ) : Manager 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