-
Notifications
You must be signed in to change notification settings - Fork 2
Section
Junaid Atari edited this page Aug 23, 2016
·
5 revisions
array
A name of the section without
@char at beginning, should be unique. A valid name contains [a-z][a-z0-9]+.
// Syntax
'component-id' => [
// ...
'section1' => [
// files here
//...
],
'section2' => [
// files here
// ....
],
// other sections
]array Pairs of key=>value.
Define the section attributes.
Default is
[]
// Example
'font-awesome' => [
// ...
'section1' => [
'@attributes' => [
'foo' => 'bar',
],
// ...
],
// ...
]boolean (Default value: false)
Removes section name from paths and urls.
// Example
'font-awesome' => [
// ...
'css' => [
// ...
'@attributes' => [
'noNameInPathUrls'=>false
]
// ...
],
// ...
],/** @var \yii2cdn\Section $section */
$section = \Yii::$app->cdn->get('font-awesome')->getSection('css');
// Get attribute value
echo $section->getAttr('attribute');
// output: value
// Update/Set attribute
echo $section->setAttr('attribute', 'value');
// output: value
// Get all the attributes
print_r ( $section->getAttributes() );Those section will be skipped when the constant
YII2CDN_OFFLINEvalue set tofalse. (see Force using offline files )
Please use the
@offlineSectionsproperty of theCdnto define the offline sections:
// Syntax
'component-id' => [
'@offlineSections' => [
'section1',
],
// ...
'section1' => [
// ...
],
// another section
/*'section2' => [
// ...
],*/
]Copyright (c) 2016 Junaid Atari and it's contributes.