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 = false
Flag: whether or not to consume JS aggregated in the dojo() view helper when generate the module layer contents
false
Details- Type
- bool


bool $_consumeOnLoad = false
Flag: whether or not to consume dojo.addOnLoad events registered with the dojo() view helper when generating the module layer file contents
false
Details- 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) : void
Constructor
Name | Type | Description |
---|---|---|
$options | array | \Zend_Config |
Exception | Description |
---|---|
\Zend_Dojo_Exception | for invalid option argument |


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


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


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


addProfileOptions(array $options) : \Zend_Dojo_BuildLayer
Add 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_BuildLayer
Add 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_BuildLayer
Remove all build profile options
Type | Description |
---|---|
\Zend_Dojo_BuildLayer |


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


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


getDojoHelper() : \Zend_Dojo_View_Helper_Dojo_Container
Retrieve 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 | null
Get custom layer script path
Type | Description |
---|---|
string | null |


getProfileOption(string $key) : mixed
Retrieve 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 | null
Retrieve view object
Type | Description |
---|---|
\Zend_View_Interface | null |


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


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


setConsumeJavascript(bool $flag) : \Zend_Dojo_BuildLayer
Set 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_BuildLayer
Set 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_BuildLayer
Set dojo() view helper instance
Name | Type | Description |
---|---|---|
$helper | \Zend_Dojo_View_Helper_Dojo_Container |
Type | Description |
---|---|
\Zend_Dojo_BuildLayer |


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


setLayerScriptPath(string $path) : \Zend_Dojo_BuildLayer
Set 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_BuildLayer
Set 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_BuildLayer
Set many build profile options at once
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
\Zend_Dojo_BuildLayer |


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


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