PHP Class AssetCompress\Routing\Filter\AssetCompressorFilter

Inheritance: extends Cake\Routing\DispatcherFilter
Show file Open project: markstory/asset_compress

Public Properties

Property Type Description
$priority integer Filter priority, we need it to run before router

Protected Properties

Property Type Description
$config MiniAsset\AssetConfig Object containing configuration settings for asset compressor

Public Methods

Method Description
beforeDispatch ( Cake\Event\Event $event ) : Response | null Checks if request is for a compiled asset, otherwise skip any operation

Protected Methods

Method Description
_getConfig ( ) : AssetConfig Config setter, used for testing the filter.
getName ( AssetConfig $config, string $url ) : boolean | string Returns the build name for a requested asset

Method Details

_getConfig() protected method

Config setter, used for testing the filter.
protected _getConfig ( ) : AssetConfig
return MiniAsset\AssetConfig The completed config instance.

beforeDispatch() public method

Checks if request is for a compiled asset, otherwise skip any operation
public beforeDispatch ( Cake\Event\Event $event ) : Response | null
$event Cake\Event\Event containing the request and response object
return Cake\Network\Response | null Response if the client is requesting a recognized asset, null otherwise

getName() protected method

Returns the build name for a requested asset
protected getName ( AssetConfig $config, string $url ) : boolean | string
$config MiniAsset\AssetConfig The config object to use.
$url string The url to get an asset name from.
return boolean | string false if no build can be parsed from URL with url path otherwise

Property Details

$config protected property

Object containing configuration settings for asset compressor
protected AssetConfig,MiniAsset $config
return MiniAsset\AssetConfig

$priority public property

Filter priority, we need it to run before router
public int $priority
return integer