Dojo module layer and custom build profile generation support

package Zend_Dojo
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructor

__construct(array|\Zend_Config $options = null) : void

Parameters

$options

array\Zend_Config

Exceptions

\Zend_Dojo_Exception for invalid option argument

Add a single build profile option

addProfileOption(string $key, \value $value) : \Zend_Dojo_BuildLayer

Parameters

$key

string

$value

\value

Returns

\Zend_Dojo_BuildLayer

Add many build profile options at once

addProfileOptions(array $options) : \Zend_Dojo_BuildLayer

Parameters

$options

array

Returns

\Zend_Dojo_BuildLayer

Add a build profile dependency prefix

addProfilePrefix(string $prefix, null|string $path = null) : \Zend_Dojo_BuildLayer

If just the prefix is passed, sets path to "../$prefix".

Parameters

$prefix

string

$path

nullstring

Returns

\Zend_Dojo_BuildLayer

Remove all build profile options

clearProfileOptions() : \Zend_Dojo_BuildLayer

Returns

\Zend_Dojo_BuildLayer

Get flag indicating whether or not to consume JS aggregated in dojo() view helper

consumeJavascript() : boolean

Returns

boolean

Get flag indicating whether or not to consume dojo.addOnLoad events aggregated in dojo() view helper

consumeOnLoad() : boolean

Returns

boolean

Generate build profile

generateBuildProfile() : string

Returns

string

Generate module layer script

generateLayerScript() : string

Returns

string

Retrieve dojo() view helper instance

getDojoHelper() : \Zend_Dojo_View_Helper_Dojo_Container

Will retrieve it from the view object if not registered.

Exceptions

\Zend_Dojo_Exception if not registered and no view object found

Returns

\Zend_Dojo_View_Helper_Dojo_Container

Retrieve custom layer name

getLayerName() : string | null

Returns

stringnull

Get custom layer script path

getLayerScriptPath() : string | null

Returns

stringnull

Retrieve a single build profile option

getProfileOption(string $key) : mixed

Returns null if profile option does not exist.

Parameters

$key

string

Returns

mixed

Get all build profile options

getProfileOptions() : array

Returns

array

Get build profile dependency prefixes

getProfilePrefixes() : array

Returns

array

Retrieve view object

getView() : \Zend_View_Interface | null

Returns

\Zend_View_Interfacenull

Is a given build profile option set?

hasProfileOption(string $key) : boolean

Parameters

$key

string

Returns

boolean

Remove a build profile option

removeProfileOption(string $name) : \Zend_Dojo_BuildLayer

Parameters

$name

string

Returns

\Zend_Dojo_BuildLayer

Set flag indicating whether or not to consume JS aggregated in dojo() view helper

setConsumeJavascript(boolean $flag) : \Zend_Dojo_BuildLayer

Parameters

$flag

boolean

Returns

\Zend_Dojo_BuildLayer

Set flag indicating whether or not to consume dojo.addOnLoad events aggregated in dojo() view helper

setConsumeOnLoad(boolean $flag) : \Zend_Dojo_BuildLayer

Parameters

$flag

boolean

Returns

\Zend_Dojo_BuildLayer

Set dojo() view helper instance

setDojoHelper(\Zend_Dojo_View_Helper_Dojo_Container $helper) : \Zend_Dojo_BuildLayer

Parameters

$helper

\Zend_Dojo_View_Helper_Dojo_Container

Returns

\Zend_Dojo_BuildLayer

Set custom layer name; e.g. "custom.main"

setLayerName(string $name) : \Zend_Dojo_BuildLayer

Parameters

$name

string

Returns

\Zend_Dojo_BuildLayer

Set the path to the custom layer script

setLayerScriptPath(string $path) : \Zend_Dojo_BuildLayer

Should be a path relative to dojo.js

Parameters

$path

string

Returns

\Zend_Dojo_BuildLayer

Set options

setOptions(array $options) : \Zend_Dojo_BuildLayer

Proxies to any setter that matches an option key.

Parameters

$options

array

Returns

\Zend_Dojo_BuildLayer

Set many build profile options at once

setProfileOptions(array $options) : \Zend_Dojo_BuildLayer

Parameters

$options

array

Returns

\Zend_Dojo_BuildLayer

Set multiple dependency prefixes for bulid profile

setProfilePrefixes(array $prefixes) : \Zend_Dojo_BuildLayer

Parameters

$prefixes

array

Returns

\Zend_Dojo_BuildLayer

Set View object

setView(\Zend_View_Interface $view) : \Zend_Dojo_BuildLayer

Parameters

$view

\Zend_View_Interface

Returns

\Zend_Dojo_BuildLayer

Filter a JSON build profile to JavaScript

_filterJsonProfileToJavascript(string $profile) : string

Parameters

$profile

string

Returns

string

Retrieve module prefix

_getPrefix(string $module) : void

Parameters

$module

string

 Properties

 

Flag: whether or not to consume JS aggregated in the dojo() view helper when generate the module layer contents

$_consumeJavascript : boolean

Default

false
 

Flag: whether or not to consume dojo.addOnLoad events registered with the dojo() view helper when generating the module layer file contents

$_consumeOnLoad : boolean

Default

false
 

Dojo view helper reference

$_dojo : \Zend_Dojo_View_Helper_Dojo_Container

Default

 

Name of the custom layer to generate

$_layerName : string

Default

 

Path to the custom layer script relative to dojo.js (used when creating the build profile)

$_layerScriptPath : string

Default

 

Build profile options

$_profileOptions : array

Default

array('action' => 'release', 'optimize' => 'shrinksafe', 'layerOptimize' => 'shrinksafe', 'copyTests' => false, 'loader' => 'default', 'cssOptimize' => 'comments')
 

Associative array of module/path pairs for the build profile

$_profilePrefixes : array

Default

array()
 

Zend_View reference

$_view : \Zend_View_Interface

Default