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

Public Member Functions

 setView (Zend_View_Interface $view)
 Set view object.
 
 enable ()
 Enable dojo.
 
 disable ()
 Disable dojo.
 
 isEnabled ()
 Is dojo enabled?
 
 setOptions ($options)
 Add options for the Dojo Container to use.
 
 requireModule ($modules)
 Specify one or multiple modules to require.
 
 getModules ()
 Retrieve list of modules to require.
 
 registerModulePath ($module, $path)
 Register a module path.
 
 getModulePaths ()
 List registered module paths.
 
 addLayer ($path)
 Add layer (custom build) path.
 
 getLayers ()
 Get registered layers.
 
 removeLayer ($path)
 Remove a registered layer.
 
 clearLayers ()
 Clear all registered layers.
 
 setCdnBase ($url)
 Set CDN base path.
 
 getCdnBase ()
 Return CDN base URL.
 
 setCdnVersion ($version=null)
 Use CDN, using version specified.
 
 getCdnVersion ()
 Get CDN version.
 
 setCdnDojoPath ($path)
 Set CDN path to dojo (relative to CDN base + version)
 
 getCdnDojoPath ()
 Get CDN path to dojo (relative to CDN base + version)
 
 useCdn ()
 Are we using the CDN?
 
 setLocalPath ($path)
 Set path to local dojo.
 
 getLocalPath ()
 Get local path to dojo.
 
 useLocalPath ()
 Are we using a local path?
 
 setDjConfig (array $config)
 Set Dojo configuration.
 
 setDjConfigOption ($option, $value)
 Set Dojo configuration option.
 
 getDjConfig ()
 Retrieve dojo configuration values.
 
 getDjConfigOption ($option, $default=null)
 Get dojo configuration value.
 
 addStylesheetModule ($module)
 Add a stylesheet by module name.
 
 getStylesheetModules ()
 Get all stylesheet modules currently registered.
 
 addStylesheet ($path)
 Add a stylesheet.
 
 registerDojoStylesheet ($flag=null)
 Register the dojo.css stylesheet?
 
 getStylesheets ()
 Retrieve registered stylesheets.
 
 addOnLoad ($callback)
 Add a script to execute onLoad.
 
 prependOnLoad ($callback)
 Prepend an onLoad event to the list of onLoad actions.
 
 getOnLoadActions ()
 Retrieve all registered onLoad actions.
 
 onLoadCaptureStart ()
 Start capturing routines to run onLoad.
 
 onLoadCaptureEnd ()
 Stop capturing routines to run onLoad.
 
 addDijit ($id, array $params)
 Add a programmatic dijit.
 
 setDijit ($id, array $params)
 Set a programmatic dijit (overwrites)
 
 addDijits (array $dijits)
 Add multiple dijits at once.
 
 setDijits (array $dijits)
 Set multiple dijits at once (overwrites)
 
 hasDijit ($id)
 Is the given programmatic dijit already registered?
 
 getDijit ($id)
 Retrieve a dijit by id.
 
 getDijits ()
 Retrieve all dijits.
 
 removeDijit ($id)
 Remove a programmatic dijit if it exists.
 
 clearDijits ()
 Clear all dijits.
 
 dijitsToJson ()
 Render dijits as JSON structure.
 
 registerDijitLoader ()
 Create dijit loader functionality.
 
 addJavascript ($js)
 Add arbitrary javascript to execute in dojo JS container.
 
 getJavascript ()
 Return all registered javascript statements.
 
 clearJavascript ()
 Clear arbitrary javascript stack.
 
 javascriptCaptureStart ()
 Capture arbitrary javascript to include in dojo script.
 
 javascriptCaptureEnd ()
 Finish capturing arbitrary javascript to include in dojo script.
 
 __toString ()
 String representation of dojo environment.
 
 _addZendLoad ($callback)
 Add an onLoad action related to ZF dijit creation.
 
 _getZendLoadActions ()
 Retrieve all ZF dijit callbacks.
 

Public Attributes

 $view
 

Protected Member Functions

 _getLocalRelativePath ()
 Retrieve local path to dojo resources for building relative paths.
 
 _renderStylesheets ()
 Render dojo stylesheets.
 
 _renderDjConfig ()
 Render DjConfig values.
 
 _renderDojoScriptTag ()
 Render dojo script tag.
 
 _renderLayers ()
 Render layers (custom builds) as script tags.
 
 _renderExtras ()
 Render dojo module paths and requires.
 

Protected Attributes

 $_captureLock = false
 
 $_captureObj
 
 $_cdnBase = Zend_Dojo::CDN_BASE_GOOGLE
 
 $_cdnDojoPath = Zend_Dojo::CDN_DOJO_PATH_GOOGLE
 
 $_cdnVersion = '1.5.0'
 
 $_dijitLoaderRegistered = false
 
 $_dijits = array()
 
 $_djConfig = array()
 
 $_enabled = false
 
 $_isXhtml = false
 
 $_javascriptStatements = array()
 
 $_layers = array()
 
 $_localPath = null
 
 $_localRelativePath = null
 
 $_modules = array()
 
 $_modulePaths = array()
 
 $_onLoadActions = array()
 
 $_registerDojoStylesheet = false
 
 $_stylesheetModules = array()
 
 $_stylesheets = array()
 
 $_zendLoadActions = array()
 

Member Function Documentation

__toString ( )

String representation of dojo environment.

Returns
string
_addZendLoad (   $callback)

Add an onLoad action related to ZF dijit creation.

This method is public, but prefixed with an underscore to indicate that it should not normally be called by userland code. It is pertinent to ensuring that the correct order of operations occurs during dijit creation.

Parameters
string$callback
Returns
Zend_Dojo_View_Helper_Dojo_Container
_getLocalRelativePath ( )
protected

Retrieve local path to dojo resources for building relative paths.

Returns
string
_getZendLoadActions ( )

Retrieve all ZF dijit callbacks.

Returns
array
_renderDjConfig ( )
protected

Render DjConfig values.

Returns
string
_renderDojoScriptTag ( )
protected

Render dojo script tag.

Renders Dojo script tag by utilizing either local path provided or the CDN. If any djConfig values were set, they will be serialized and passed with that attribute.

Returns
string
_renderExtras ( )
protected

Render dojo module paths and requires.

Returns
string
_renderLayers ( )
protected

Render layers (custom builds) as script tags.

Returns
string
_renderStylesheets ( )
protected

Render dojo stylesheets.

Returns
string
addDijit (   $id,
array  $params 
)

Add a programmatic dijit.

Parameters
string$id
array$params
Returns
Zend_Dojo_View_Helper_Dojo_Container
addDijits ( array  $dijits)

Add multiple dijits at once.

Expects an array of id => array $params pairs

Parameters
array$dijits
Returns
Zend_Dojo_View_Helper_Dojo_Container
addJavascript (   $js)

Add arbitrary javascript to execute in dojo JS container.

Parameters
string$js
Returns
Zend_Dojo_View_Helper_Dojo_Container
addLayer (   $path)

Add layer (custom build) path.

Parameters
string$path
Returns
Zend_Dojo_View_Helper_Dojo_Container
addOnLoad (   $callback)

Add a script to execute onLoad.

dojo.addOnLoad accepts:

  • function name
  • lambda
Parameters
string$callbackLambda
Returns
Zend_Dojo_View_Helper_Dojo_Container
addStylesheet (   $path)

Add a stylesheet.

Parameters
string$path
Returns
Zend_Dojo_View_Helper_Dojo_Container
addStylesheetModule (   $module)

Add a stylesheet by module name.

Parameters
string$module
Returns
Zend_Dojo_View_Helper_Dojo_Container
clearDijits ( )

Clear all dijits.

Returns
Zend_Dojo_View_Helper_Dojo_Container
clearJavascript ( )

Clear arbitrary javascript stack.

Returns
Zend_Dojo_View_Helper_Dojo_Container
clearLayers ( )

Clear all registered layers.

Returns
Zend_Dojo_View_Helper_Dojo_Container
dijitsToJson ( )

Render dijits as JSON structure.

Returns
string
disable ( )
enable ( )
getCdnBase ( )

Return CDN base URL.

Returns
string
getCdnDojoPath ( )

Get CDN path to dojo (relative to CDN base + version)

Returns
string
getCdnVersion ( )

Get CDN version.

Returns
string
getDijit (   $id)

Retrieve a dijit by id.

Parameters
string$id
Returns
array|null
getDijits ( )

Retrieve all dijits.

Returns dijits as an array of assoc arrays

Returns
array
getDjConfig ( )

Retrieve dojo configuration values.

Returns
array
getDjConfigOption (   $option,
  $default = null 
)

Get dojo configuration value.

Parameters
string$option
mixed$default
Returns
mixed
getJavascript ( )

Return all registered javascript statements.

Returns
array
getLayers ( )

Get registered layers.

Returns
array
getLocalPath ( )

Get local path to dojo.

Returns
string
getModulePaths ( )

List registered module paths.

Returns
array
getModules ( )

Retrieve list of modules to require.

Returns
array
getOnLoadActions ( )

Retrieve all registered onLoad actions.

Returns
array
getStylesheetModules ( )

Get all stylesheet modules currently registered.

Returns
array
getStylesheets ( )

Retrieve registered stylesheets.

Returns
array
hasDijit (   $id)

Is the given programmatic dijit already registered?

Parameters
string$id
Returns
bool
isEnabled ( )

Is dojo enabled?

Returns
bool
javascriptCaptureEnd ( )

Finish capturing arbitrary javascript to include in dojo script.

Returns
true
javascriptCaptureStart ( )

Capture arbitrary javascript to include in dojo script.

Returns
void
onLoadCaptureEnd ( )

Stop capturing routines to run onLoad.

Returns
bool
onLoadCaptureStart ( )

Start capturing routines to run onLoad.

Returns
bool
prependOnLoad (   $callback)

Prepend an onLoad event to the list of onLoad actions.

Parameters
string$callbackLambda
Returns
Zend_Dojo_View_Helper_Dojo_Container
registerDijitLoader ( )

Create dijit loader functionality.

Returns
void
registerDojoStylesheet (   $flag = null)

Register the dojo.css stylesheet?

With no arguments, returns the status of the flag; with arguments, sets the flag and returns the object.

Parameters
null | bool$flag
Returns
Zend_Dojo_View_Helper_Dojo_Container|bool
registerModulePath (   $module,
  $path 
)

Register a module path.

Parameters
string$moduleThe module to register a path for
string$pathThe path to register for the module
Returns
Zend_Dojo_View_Helper_Dojo_Container
removeDijit (   $id)

Remove a programmatic dijit if it exists.

Parameters
string$id
Returns
Zend_Dojo_View_Helper_Dojo_Container
removeLayer (   $path)

Remove a registered layer.

Parameters
string$path
Returns
Zend_Dojo_View_Helper_Dojo_Container
requireModule (   $modules)

Specify one or multiple modules to require.

Parameters
string | array$modules
Returns
Zend_Dojo_View_Helper_Dojo_Container
setCdnBase (   $url)

Set CDN base path.

Parameters
string$url
Returns
Zend_Dojo_View_Helper_Dojo_Container
setCdnDojoPath (   $path)

Set CDN path to dojo (relative to CDN base + version)

Parameters
string$path
Returns
Zend_Dojo_View_Helper_Dojo_Container
setCdnVersion (   $version = null)

Use CDN, using version specified.

Parameters
string$version
Returns
Zend_Dojo_View_Helper_Dojo_Container
setDijit (   $id,
array  $params 
)

Set a programmatic dijit (overwrites)

Parameters
string$id
array$params
Returns
Zend_Dojo_View_Helper_Dojo_Container
setDijits ( array  $dijits)

Set multiple dijits at once (overwrites)

Expects an array of id => array $params pairs

Parameters
array$dijits
Returns
Zend_Dojo_View_Helper_Dojo_Container
setDjConfig ( array  $config)

Set Dojo configuration.

Parameters
string$option
mixed$value
Returns
Zend_Dojo_View_Helper_Dojo_Container
setDjConfigOption (   $option,
  $value 
)

Set Dojo configuration option.

Parameters
string$option
mixed$value
Returns
Zend_Dojo_View_Helper_Dojo_Container
setLocalPath (   $path)

Set path to local dojo.

Parameters
string$path
Returns
Zend_Dojo_View_Helper_Dojo_Container
setOptions (   $options)

Add options for the Dojo Container to use.

Parameters
array|Zend_ConfigArray or Zend_Config object with options to use
Returns
Zend_Dojo_View_Helper_Dojo_Container
setView ( Zend_View_Interface  $view)

Set view object.

Parameters
Zend_Dojo_View_Interface$view
Returns
void
useCdn ( )

Are we using the CDN?

Returns
bool
useLocalPath ( )

Are we using a local path?

Returns
bool

Member Data Documentation

$_captureLock = false
protected
$_captureObj
protected
$_cdnBase = Zend_Dojo::CDN_BASE_GOOGLE
protected
$_cdnDojoPath = Zend_Dojo::CDN_DOJO_PATH_GOOGLE
protected
$_cdnVersion = '1.5.0'
protected
$_dijitLoaderRegistered = false
protected
$_dijits = array()
protected
$_djConfig = array()
protected
$_enabled = false
protected
$_isXhtml = false
protected
$_javascriptStatements = array()
protected
$_layers = array()
protected
$_localPath = null
protected
$_localRelativePath = null
protected
$_modulePaths = array()
protected
$_modules = array()
protected
$_onLoadActions = array()
protected
$_registerDojoStylesheet = false
protected
$_stylesheetModules = array()
protected
$_stylesheets = array()
protected
$_zendLoadActions = array()
protected
$view