Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Dojo_BuildLayer Class Reference

Public Member Functions

 __construct ($options=null)
 Constructor.
 
 setOptions (array $options)
 Set options.
 
 setView (Zend_View_Interface $view)
 Set View object.
 
 getView ()
 Retrieve view object.
 
 setDojoHelper (Zend_Dojo_View_Helper_Dojo_Container $helper)
 Set dojo() view helper instance.
 
 getDojoHelper ()
 Retrieve dojo() view helper instance.
 
 setLayerName ($name)
 Set custom layer name; e.g.
 
 getLayerName ()
 Retrieve custom layer name.
 
 setLayerScriptPath ($path)
 Set the path to the custom layer script.
 
 getLayerScriptPath ()
 Get custom layer script path.
 
 setConsumeJavascript ($flag)
 Set flag indicating whether or not to consume JS aggregated in dojo() view helper.
 
 consumeJavascript ()
 Get flag indicating whether or not to consume JS aggregated in dojo() view helper.
 
 setConsumeOnLoad ($flag)
 Set flag indicating whether or not to consume dojo.addOnLoad events aggregated in dojo() view helper.
 
 consumeOnLoad ()
 Get flag indicating whether or not to consume dojo.addOnLoad events aggregated in dojo() view helper.
 
 setProfileOptions (array $options)
 Set many build profile options at once.
 
 addProfileOptions (array $options)
 Add many build profile options at once.
 
 addProfileOption ($key, $value)
 Add a single build profile option.
 
 hasProfileOption ($key)
 Is a given build profile option set?
 
 getProfileOption ($key)
 Retrieve a single build profile option.
 
 getProfileOptions ()
 Get all build profile options.
 
 removeProfileOption ($name)
 Remove a build profile option.
 
 clearProfileOptions ()
 Remove all build profile options.
 
 addProfilePrefix ($prefix, $path=null)
 Add a build profile dependency prefix.
 
 setProfilePrefixes (array $prefixes)
 Set multiple dependency prefixes for bulid profile.
 
 getProfilePrefixes ()
 Get build profile dependency prefixes.
 
 generateLayerScript ()
 Generate module layer script.
 
 generateBuildProfile ()
 Generate build profile.
 

Protected Member Functions

 _getPrefix ($module)
 Retrieve module prefix.
 
 _filterJsonProfileToJavascript ($profile)
 Filter a JSON build profile to JavaScript.
 

Protected Attributes

 $_consumeJavascript = false
 
 $_consumeOnLoad = false
 
 $_dojo
 
 $_layerName
 
 $_layerScriptPath
 
 $_profileOptions
 
 $_profilePrefixes = array()
 
 $_view
 

Constructor & Destructor Documentation

__construct (   $options = null)

Constructor.

Parameters
array | Zend_Config$options
Returns
void
Exceptions
Zend_Dojo_Exceptionfor invalid option argument

Member Function Documentation

_filterJsonProfileToJavascript (   $profile)
protected

Filter a JSON build profile to JavaScript.

Parameters
string$profile
Returns
string
_getPrefix (   $module)
protected

Retrieve module prefix.

Parameters
string$module
Returns
void
addProfileOption (   $key,
  $value 
)

Add a single build profile option.

Parameters
string$key
value$value
Returns
Zend_Dojo_BuildLayer
addProfileOptions ( array  $options)

Add many build profile options at once.

Parameters
array$options
Returns
Zend_Dojo_BuildLayer
addProfilePrefix (   $prefix,
  $path = null 
)

Add a build profile dependency prefix.

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

Parameters
string$prefix
null | string$path
Returns
Zend_Dojo_BuildLayer
clearProfileOptions ( )

Remove all build profile options.

Returns
Zend_Dojo_BuildLayer
consumeJavascript ( )

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

Returns
bool
consumeOnLoad ( )

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

Returns
bool
generateBuildProfile ( )

Generate build profile.

Returns
string
generateLayerScript ( )

Generate module layer script.

Returns
string
getDojoHelper ( )

Retrieve dojo() view helper instance.

Will retrieve it from the view object if not registered.

Returns
Zend_Dojo_View_Helper_Dojo_Container
Exceptions
Zend_Dojo_Exceptionif not registered and no view object found
getLayerName ( )

Retrieve custom layer name.

Returns
string|null
getLayerScriptPath ( )

Get custom layer script path.

Returns
string|null
getProfileOption (   $key)

Retrieve a single build profile option.

Returns null if profile option does not exist.

Parameters
string$key
Returns
mixed
getProfileOptions ( )

Get all build profile options.

Returns
array
getProfilePrefixes ( )

Get build profile dependency prefixes.

Returns
array
getView ( )

Retrieve view object.

Returns
Zend_View_Interface|null
hasProfileOption (   $key)

Is a given build profile option set?

Parameters
string$key
Returns
bool
removeProfileOption (   $name)

Remove a build profile option.

Parameters
string$name
Returns
Zend_Dojo_BuildLayer
setConsumeJavascript (   $flag)

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

Parameters
bool$flag
Returns
Zend_Dojo_BuildLayer
setConsumeOnLoad (   $flag)

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

Parameters
bool$flag
Returns
Zend_Dojo_BuildLayer
setDojoHelper ( Zend_Dojo_View_Helper_Dojo_Container  $helper)

Set dojo() view helper instance.

Parameters
Zend_Dojo_View_Helper_Dojo_Container$helper
Returns
Zend_Dojo_BuildLayer
setLayerName (   $name)

Set custom layer name; e.g.

"custom.main"

Parameters
string$name
Returns
Zend_Dojo_BuildLayer
setLayerScriptPath (   $path)

Set the path to the custom layer script.

Should be a path relative to dojo.js

Parameters
string$path
Returns
Zend_Dojo_BuildLayer
setOptions ( array  $options)

Set options.

Proxies to any setter that matches an option key.

Parameters
array$options
Returns
Zend_Dojo_BuildLayer
setProfileOptions ( array  $options)

Set many build profile options at once.

Parameters
array$options
Returns
Zend_Dojo_BuildLayer
setProfilePrefixes ( array  $prefixes)

Set multiple dependency prefixes for bulid profile.

Parameters
array$prefixes
Returns
Zend_Dojo_BuildLayer
setView ( Zend_View_Interface  $view)

Set View object.

Parameters
Zend_View_Interface$view
Returns
Zend_Dojo_BuildLayer

Member Data Documentation

$_consumeJavascript = false
protected
$_consumeOnLoad = false
protected
$_dojo
protected
$_layerName
protected
$_layerScriptPath
protected
$_profileOptions
protected
Initial value:
= array(
'action' => 'release',
'optimize' => 'shrinksafe',
'layerOptimize' => 'shrinksafe',
'copyTests' => false,
'loader' => 'default',
'cssOptimize' => 'comments',
)
$_profilePrefixes = array()
protected
$_view
protected