JavascriptImporter
Importer JS Filter
Class used to import referenced javascript files.
class Winter\Storm\Parse\Assetic\Filter\JavascriptImporter
extends Assetic\Filter\BaseFilter
=include library/jquery.js; =require library/jquery.js;
(@todo Below needs fixing) =define #FOO "Bar"; console.log(#FOO);
Extends
Class | Description |
---|---|
Assetic\Filter\BaseFilter
|
Properties
protected
$definedVars
:
array
= []
Variables defined by this script.
protected
$includedFiles
:
array
= []
Cache of required files.
protected $scriptFile : string
File name for the processed JS script.
protected $scriptPath : string
Location of where the processed JS script resides.
Methods
public filterDump (Assetic\Contracts\Asset\AssetInterface $asset)
Parameters
Property | Type | Description |
---|---|---|
$asset | Assetic\Contracts\Asset\AssetInterface |
Assetic\Contracts\Asset\AssetInterface
|
Returns
mixed
protected directiveDefine ($data)
Directive to define and replace variables
Parameters
Property | Type | Description |
---|---|---|
$data | mixed |
mixed
|
Returns
mixed
protected
directiveInclude ($data, boolean $required = false
)
Directive to process script includes
Parameters
Property | Type | Description |
---|---|---|
$data | mixed |
mixed
|
$required | boolean |
boolean
|
Returns
mixed
protected directiveRequire ($data)
Directive to process mandatory script includes
Parameters
Property | Type | Description |
---|---|---|
$data | mixed |
mixed
|
Returns
mixed
protected parse (string $content) : string
Process JS imports inside a string of JavaScript
Parameters
Property | Type | Description |
---|---|---|
$content | string |
string
JS code to process. |
Returns
string
Processed JS.
← Previous page
Winter\Storm\Parse\Assetic\Cache\FilesystemCache
Next page →
Winter\Storm\Parse\Assetic\Filter\LessCompiler
Copyright © 2024 Winter CMS