PHP 클래스 AssetCompress\View\Helper\AssetCompressHelper

Handle inclusion assets using the AssetCompress features for concatenating and compressing asset files.
상속: extends Cake\View\Helper
파일 보기 프로젝트 열기: markstory/asset_compress

공개 프로퍼티들

프로퍼티 타입 설명
$helpers array Helpers used.

보호된 프로퍼티들

프로퍼티 타입 설명
$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