PHP Класс AssetCompress\View\Helper\AssetCompressHelper

Handle inclusion assets using the AssetCompress features for concatenating and compressing asset files.
Наследование: extends Cake\View\Helper
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$helpers array Helpers used.

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

Свойство Тип Описание
$collection MiniAsset\AssetCollection AssetCollection for the current config set.
$config MiniAsset\AssetConfig Configuration object
$factory AssetCompress\Factory Factory for other AssetCompress objects.
$writer MiniAsset\Output\AssetWriter AssetWriter instance

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

Метод Описание
__construct ( Cake\View\View $view, array $settings = [] ) : void Constructor - finds and parses the ini file the plugin uses.
assetConfig ( AssetConfig $config = null ) : AssetConfig | null Modify the runtime configuration of the helper.
css ( string $file, array $options = [] ) : string Create a CSS file. Will generate link tags for either the dynamic build controller, or the generated file if it exists.
exists ( string $file ) : boolean Check if a build exists (is defined and have at least one file) in the ini file.
inlineCss ( string $file ) : string Create a CSS file. Will generate inline style tags in production, or reference the dynamic build file in development
inlineScript ( string $file ) : string Create an inline script tag for a script asset. Will generate inline script tags in production, or reference the dynamic build file in development.
script ( string $file, array $options = [] ) : A Create a script tag for a script asset. Will generate script tags for either the dynamic build controller, or the generated file if it exists.
url ( string $file = null, boolean | array $full = false ) : string Get the URL for a given asset name.

Защищенные методы

Метод Описание
_addExt ( string $file, string $ext ) : string Adds an extension if the file doesn't already end with it.
_getBuildName ( AssetTarget $build ) : string Get the build file name.
_getRoute ( AssetTarget $file, string $base ) : string Get the dynamic build path for an asset.
_relativizePath ( string $path ) : string Converts an absolute path into a web relative one.
collection ( ) : AssetCollection Get the AssetCollection
factory ( ) : Factory Get the AssetCompress factory based on the config object.
writer ( ) : AssetWriter Get the AssetWriter

Описание методов

__construct() публичный метод

Constructor - finds and parses the ini file the plugin uses.
public __construct ( Cake\View\View $view, array $settings = [] ) : void
$view Cake\View\View The view instance to use.
$settings array The settings for the helper.
Результат void

_addExt() защищенный метод

Adds an extension if the file doesn't already end with it.
protected _addExt ( string $file, string $ext ) : string
$file string Filename
$ext string Extension with .
Результат string

_getBuildName() защищенный метод

Generates filenames that are intended for production use with statically generated files.
protected _getBuildName ( AssetTarget $build ) : string
$build MiniAsset\AssetTarget The build being resolved.
Результат string The resolved build name.

_getRoute() защищенный метод

This generates URLs that work with the development dispatcher filter.
protected _getRoute ( AssetTarget $file, string $base ) : string
$file MiniAsset\AssetTarget The build file you want to make a url for.
$base string The base path to fetch a url with.
Результат string Generated URL.

_relativizePath() защищенный метод

Converts an absolute path into a web relative one.
protected _relativizePath ( string $path ) : string
$path string The path to convert
Результат string A webroot relative string.

assetConfig() публичный метод

Used as a get/set for the ini file values.
public assetConfig ( AssetConfig $config = null ) : AssetConfig | null
$config MiniAsset\AssetConfig The config instance to set.
Результат MiniAsset\AssetConfig | null Either the current config object or null.

collection() защищенный метод

Get the AssetCollection
protected collection ( ) : AssetCollection
Результат MiniAsset\AssetCollection

css() публичный метод

To create build files without configuration use addCss() Options: - All options supported by HtmlHelper::css() are supported. - raw - Set to true to get one link element for each file in the build.
public css ( string $file, array $options = [] ) : string
$file string A build target to include.
$options array An array of options for the stylesheet tag.
Результат string A stylesheet tag

exists() публичный метод

Check if a build exists (is defined and have at least one file) in the ini file.
public exists ( string $file ) : boolean
$file string Name of the build that will be checked if exists.
Результат boolean True if the build file exists.

factory() защищенный метод

Get the AssetCompress factory based on the config object.
protected factory ( ) : Factory
Результат AssetCompress\Factory

inlineCss() публичный метод

To create build files without configuration use addCss() Options: - All options supported by HtmlHelper::css() are supported.
public inlineCss ( string $file ) : string
$file string A build target to include.
Результат string style tag

inlineScript() публичный метод

To create build files without configuration use addScript() Options: - All options supported by HtmlHelper::css() are supported.
public inlineScript ( string $file ) : string
$file string A build target to include.
Результат string script tag

script() публичный метод

To create build files without configuration use addScript() Options: - All options supported by HtmlHelper::css() are supported. - raw - Set to true to get one script element for each file in the build.
public script ( string $file, array $options = [] ) : A
$file string A build target to include.
$options array An array of options for the script tag.
Результат A script tag

url() публичный метод

Takes an build filename, and returns the URL to that build file.
public url ( string $file = null, boolean | array $full = false ) : string
$file string The build file that you want a URL for.
$full boolean | array Whether or not the URL should have the full base path.
Результат string The generated URL.

writer() защищенный метод

Get the AssetWriter
protected writer ( ) : AssetWriter
Результат MiniAsset\Output\AssetWriter

Описание свойств

$collection защищенное свойство

AssetCollection for the current config set.
protected AssetCollection,MiniAsset $collection
Результат MiniAsset\AssetCollection

$config защищенное свойство

Configuration object
protected AssetConfig,MiniAsset $config
Результат MiniAsset\AssetConfig

$factory защищенное свойство

Factory for other AssetCompress objects.
protected Factory,AssetCompress $factory
Результат AssetCompress\Factory

$helpers публичное свойство

Helpers used.
public array $helpers
Результат array

$writer защищенное свойство

AssetWriter instance
protected AssetWriter,MiniAsset\Output $writer
Результат MiniAsset\Output\AssetWriter