Dojo/BuildLayer.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Dojo
- Version
- $Id: BuildLayer.php 25024 2012-07-30 15:08:15Z rob $
\Zend_Dojo_BuildLayer
Dojo module layer and custom build profile generation support
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

bool $_consumeJavascript = falseFlag: whether or not to consume JS aggregated in the dojo() view helper when generate the module layer contents
falseDetails- Type
- bool

bool $_consumeOnLoad = falseFlag: whether or not to consume dojo.addOnLoad events registered with the dojo() view helper when generating the module layer file contents
falseDetails- Type
- bool

string $_layerScriptPath = Path to the custom layer script relative to dojo.js (used when creating the build profile)
- Type
- string

array $_profileOptions = array('action' => 'release', 'optimize' => 'shrinksafe', 'layerOptimize' => 'shrinksafe', 'copyTests' => false, 'loader' => 'default', 'cssOptimize' => 'comments')Build profile options
array('action' => 'release', 'optimize' => 'shrinksafe', 'layerOptimize' => 'shrinksafe', 'copyTests' => false, 'loader' => 'default', 'cssOptimize' => 'comments')Details- Type
- array

array $_profilePrefixes = array()Associative array of module/path pairs for the build profile
array()Details- Type
- array
Methods

__construct(array | \Zend_Config $options = null) : voidConstructor
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config |
| Exception | Description |
|---|---|
| \Zend_Dojo_Exception | for invalid option argument |

_filterJsonProfileToJavascript(string $profile) : stringFilter a JSON build profile to JavaScript
| Name | Type | Description |
|---|---|---|
| $profile | string |
| Type | Description |
|---|---|
| string |

_getPrefix(string $module) : voidRetrieve module prefix
| Name | Type | Description |
|---|---|---|
| $module | string |

addProfileOption(string $key, \value $value) : \Zend_Dojo_BuildLayerAdd a single build profile option
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $value | \value |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

addProfileOptions(array $options) : \Zend_Dojo_BuildLayerAdd many build profile options at once
| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

addProfilePrefix(string $prefix, null | string $path = null) : \Zend_Dojo_BuildLayerAdd a build profile dependency prefix
If just the prefix is passed, sets path to "../$prefix".
| Name | Type | Description |
|---|---|---|
| $prefix | string | |
| $path | null | string |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

clearProfileOptions() : \Zend_Dojo_BuildLayerRemove all build profile options
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

consumeJavascript() : boolGet flag indicating whether or not to consume JS aggregated in dojo() view helper
| Type | Description |
|---|---|
| bool |

consumeOnLoad() : boolGet flag indicating whether or not to consume dojo.addOnLoad events aggregated in dojo() view helper
| Type | Description |
|---|---|
| bool |

getDojoHelper() : \Zend_Dojo_View_Helper_Dojo_ContainerRetrieve dojo() view helper instance
Will retrieve it from the view object if not registered.
| Type | Description |
|---|---|
| \Zend_Dojo_View_Helper_Dojo_Container |
| Exception | Description |
|---|---|
| \Zend_Dojo_Exception | if not registered and no view object found |

getLayerScriptPath() : string | nullGet custom layer script path
| Type | Description |
|---|---|
| string | null |

getProfileOption(string $key) : mixedRetrieve a single build profile option
Returns null if profile option does not exist.
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| mixed |

getView() : \Zend_View_Interface | nullRetrieve view object
| Type | Description |
|---|---|
| \Zend_View_Interface | null |

hasProfileOption(string $key) : boolIs a given build profile option set?
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| bool |

removeProfileOption(string $name) : \Zend_Dojo_BuildLayerRemove a build profile option
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setConsumeJavascript(bool $flag) : \Zend_Dojo_BuildLayerSet flag indicating whether or not to consume JS aggregated in dojo() view helper
| Name | Type | Description |
|---|---|---|
| $flag | bool |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setConsumeOnLoad(bool $flag) : \Zend_Dojo_BuildLayerSet flag indicating whether or not to consume dojo.addOnLoad events aggregated in dojo() view helper
| Name | Type | Description |
|---|---|---|
| $flag | bool |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setDojoHelper(\Zend_Dojo_View_Helper_Dojo_Container $helper) : \Zend_Dojo_BuildLayerSet dojo() view helper instance
| Name | Type | Description |
|---|---|---|
| $helper | \Zend_Dojo_View_Helper_Dojo_Container |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setLayerName(string $name) : \Zend_Dojo_BuildLayerSet custom layer name; e.g.
"custom.main"
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setLayerScriptPath(string $path) : \Zend_Dojo_BuildLayerSet the path to the custom layer script
Should be a path relative to dojo.js
| Name | Type | Description |
|---|---|---|
| $path | string |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setOptions(array $options) : \Zend_Dojo_BuildLayerSet options
Proxies to any setter that matches an option key.
| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setProfileOptions(array $options) : \Zend_Dojo_BuildLayerSet many build profile options at once
| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setProfilePrefixes(array $prefixes) : \Zend_Dojo_BuildLayerSet multiple dependency prefixes for bulid profile
| Name | Type | Description |
|---|---|---|
| $prefixes | array |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |

setView(\Zend_View_Interface $view) : \Zend_Dojo_BuildLayerSet View object
| Name | Type | Description |
|---|---|---|
| $view | \Zend_View_Interface |
| Type | Description |
|---|---|
| \Zend_Dojo_BuildLayer |