Class Cdn
Yii2 CDN Component
- yii\base\Component
- yii2cdn\Cdn
Package: yii2cdn
Author: Junaid Atari mj.atari@gmail.com
Version: 0.1
Located at src/Cdn.php
Methods summary
public
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
public
|
|
public static
boolean
|
|
public
|
|
public
boolean
|
|
public
|
#
getSectionByRoot( string $root, boolean $throwException = true )
Get the file by root Root example : component-id/section |
public
|
#
getFileByRoot( string $root, boolean $asUrl = false, boolean $throwException = true )
Get the file by root Root example : component-id/section/file-id |
public
|
#
whenOffline( callable $callback, string $property = 'cdn' )
Perform a callback function when Offline mode is active |
public
|
#
whenOnline( callable $callback, string $property = 'cdn' )
Perform a callback function when Online mode is active |
Properties summary
public
string
|
$baseUrl
Base url to cdn directory |
#
null
|
public
string
|
$basePath
base path to cdn directory |
#
null
|
public
array
|
$aliases
Custom url aliases, replaces with @alias(*) in files url Usage: ['xyz' => '/url/to', ...] |
#
[]
|
public
string
|
$componentClass
CDN component class default: \yii2cdn\Component |
#
'\yii2cdn\Component'
|
public
string
|
$configParserClass
CDN components configuration parser class default: \yii2cdn\ComponentConfigParser |
#
'\yii2cdn\ConfigParser'
|
public
string
|
$sectionClass
CDN component section class default: \yii2cdn\ComponentSection |
#
'\yii2cdn\Section'
|
public
string
|
$configFileClass
CDN Configuration File Class default: \yii2cdn\ConfigFile |
#
'\yii2cdn\ConfigFile'
|
public
string
|
$fileClass
CDN component section file class default: \yii2cdn\SectionFile |
#
'\yii2cdn\File'
|
public
string
|
$configLoaderClass
CDN component configuration loader class default: \yii2cdn\ConfigLoader |
#
'\yii2cdn\ConfigLoader'
|
public
array
|
$configs
CDN components configuration files list Usage: 1. 'path/to/cdn-config.php' : main file path 2. ['path/to/cdn-config.php'] : main file path 3. ['path/to/cdn-config.php', 'offline'=>false] : online cdn file path 4. ['path/to/cdn-config.php', 'offline'=>true] : offline cdn file path |
#
[]
|
public
array
|
$components
CDN components configuration |
#
[]
|
public
array
|
$sections
Sections name list default: ( css , js ) |
#
['js', 'css']
|
public
string
|
$cacheKey
Cache Key for caching built components configuration to load fast |
#
null
|
public
boolean
|
$enableCaching
Enable storing components configuration in cache |
#
false
|
protected
array
|
$_regComponents
Components registered under cdn |
#
[]
|