Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
ExtendedClientScript Class Reference

Public Member Functions

 registerCoreScript ($name, $force=false)
 registerCssFile ($file, $media= '', $timestamp=null, $combine=true, $gccFile=false, $force=false)
 registerScriptFile ($file, $position=self::POS_HEAD, $timestamp=null, $combine=true, $gccFile=false, $force=false)
 renderHead (&$output)
 renderBodyBegin (&$output)
 renderBodyEnd (&$output)
 getCoreScriptUrl ()

Public Attributes

 $disableRegisterFiles = false
 $compressCombinedJs = false
 $compressCombinedCss = false
 $combineFiles = false
 $combineJs = false
 $combineCss = false
 $excludeFiles = array()
 $filePath
 $splitDomainName
 $fileUrl
 $basePath
 $ttlDays = 1
 $prefix = 'c_'
 $jsMinPath = 'ext.ExtendedClientScript.jsmin.*'
 $cssMinPath = 'ext.ExtendedClientScript.cssmin.*'
 $cssMinFilters
 $cssMinPlugins

Detailed Description

Compress and cache used JS and CSS files. Needs jsmin and cssmin

Ties into the 1.0.4 and up Yii CClientScript functions

0.9.0 Now using CssMin code.google.com/p/cssmin/ for PHP 5.3.x compatibility

Now checking and excluding remote files automatically

Author
Maxximus maxxi.nosp@m.mus0.nosp@m.07@gm.nosp@m.ail..nosp@m.com
Alexander Makarov sam@r.nosp@m.mcre.nosp@m.ative.nosp@m..ru
Kir <>

Copyright © 2008-2011 htp://www.yiiframework.com/license/ 0.9.0

Definition at line 23 of file ExtendedClientScript.php.

Member Function Documentation

ExtendedClientScript::registerCoreScript (   $name,
  $force = false 
)

Registers a script package that is listed in packages.

Parameters
string$namethe name of the script package.
Returns
CClientScript the CClientScript object itself (to support method chaining, available since version 1.1.5).
See Also
renderCoreScript

Definition at line 128 of file ExtendedClientScript.php.

{
if ($this->disableRegisterFiles && !$force) {
return $this;
}
}
ExtendedClientScript::renderBodyBegin ( $output)

Will combine/compress JS if wanted/needed, and will continue with original renderBodyEnd afterwards

Parameters
<type>$output

Definition at line 188 of file ExtendedClientScript.php.

{
$this->processJs(parent::POS_BEGIN);
}
ExtendedClientScript::renderBodyEnd ( $output)

Will combine/compress JS if wanted/needed, and will continue with original renderBodyEnd afterwards

Parameters
<type>$output

Definition at line 200 of file ExtendedClientScript.php.

{
$this->processJs(parent::POS_END);
}
ExtendedClientScript::renderHead ( $output)

Will combine/compress JS and CSS if wanted/needed, and will continue with original renderHead afterwards

Parameters
<type>$output

Definition at line 170 of file ExtendedClientScript.php.

{
if ($this->combineFiles) {
$this->combineJs = $this->combineCss = true;
}
$this->processJs(parent::POS_HEAD);
$this->processCss();
}

Member Data Documentation

ExtendedClientScript::$basePath

Path where files can be found

Definition at line 73 of file ExtendedClientScript.php.

ExtendedClientScript::$combineCss = false

Combine all non-remote CSS files into one. Be careful with relative paths in CSS.

Definition at line 50 of file ExtendedClientScript.php.

ExtendedClientScript::$combineFiles = false

DEPRECATED/LEGACY Combine all JS and CSS files into one. Be careful with relative paths in CSS.

Definition at line 42 of file ExtendedClientScript.php.

ExtendedClientScript::$combineJs = false

Combine all non-remote JS files into one.

Definition at line 46 of file ExtendedClientScript.php.

ExtendedClientScript::$compressCombinedCss = false

Compress all CSS files with CssMin. CssMin must be installed as an extension in $cssMinPath. Specific browserhacks will be removed, so don't add them in to be compressed CSS files. code.google.com/p/cssmin/

Definition at line 37 of file ExtendedClientScript.php.

ExtendedClientScript::$compressCombinedJs = false

Compress all Javascript files with JSMin. JSMin must be installed as an extension in $jssminPath. github.com/rgrove/jsmin-php/

Definition at line 31 of file ExtendedClientScript.php.

ExtendedClientScript::$cssMinFilters
Initial value:
array
(
'ImportImports' => false,
'RemoveComments' => true,
'RemoveEmptyRulesets' => true,
'RemoveEmptyAtBlocks' => true,
'ConvertLevel3AtKeyframes' => false,
'ConvertLevel3Properties' => false,
'Variables' => true,
'RemoveLastDelarationSemiColon' => true
)

CssMin filter options. Default values according cssMin doc.

Definition at line 93 of file ExtendedClientScript.php.

ExtendedClientScript::$cssMinPath = 'ext.ExtendedClientScript.cssmin.*'

path to CssMin

Definition at line 89 of file ExtendedClientScript.php.

ExtendedClientScript::$cssMinPlugins
Initial value:
array
(
'Variables' => true,
'ConvertFontWeight' => true,
'ConvertHslColors' => true,
'ConvertRgbColors' => true,
'ConvertNamedColors' => true,
'CompressColorValues' => true,
'CompressUnitValues' => true,
'CompressExpressionValues' => true,
)

CssMin plugin options. Maximum compression and conversion.

Definition at line 107 of file ExtendedClientScript.php.

ExtendedClientScript::$excludeFiles = array()

Exclude certain files from inclusion. array('/path/to/excluded/file') Useful for fixed base and incidental additional JS.

Definition at line 55 of file ExtendedClientScript.php.

ExtendedClientScript::$filePath

Path where the combined/compressed file will be stored. Will use coreScriptUrl if not defined

Definition at line 59 of file ExtendedClientScript.php.

ExtendedClientScript::$fileUrl

Relative Url where the combined/compressed file can be found

Definition at line 69 of file ExtendedClientScript.php.

ExtendedClientScript::$jsMinPath = 'ext.ExtendedClientScript.jsmin.*'

path to JsMin

Definition at line 85 of file ExtendedClientScript.php.

ExtendedClientScript::$prefix = 'c_'

prefix for the combined/compressed files

Definition at line 81 of file ExtendedClientScript.php.

ExtendedClientScript::$ttlDays = 1

Used for garbage collection. If not accessed during that period: remove.

Definition at line 77 of file ExtendedClientScript.php.


The documentation for this class was generated from the following file: