API Documentation

Zend/Dojo/View/Helper/Dojo/Container.php

Show: inherited
Table of Contents

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 license@zend.com 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  
Subpackage
View  
Version
$Id: Container.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Dojo_View_Helper_Dojo_Container

Package: Zend\Dojo\View

Container for Dojo View Helper

Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedbool  $_captureLock= 'false'

addOnLoad capture lock

Default valuefalseDetails
Type
bool
Propertyprotectedstring  $_captureObj= ''

addOnLoad object on which to apply lambda

Details
Type
string
Propertyprotectedstring  $_cdnBase= 'Zend_Dojo::CDN_BASE_GOOGLE'

Base CDN url to utilize

Default valueZend_Dojo::CDN_BASE_GOOGLEDetails
Type
string
Propertyprotectedstring  $_cdnDojoPath= 'Zend_Dojo::CDN_DOJO_PATH_GOOGLE'

Path segment following version string of CDN path

Default valueZend_Dojo::CDN_DOJO_PATH_GOOGLEDetails
Type
string
Propertyprotectedstring  $_cdnVersion= ''1.5.0''

Dojo version to use from CDN

Default value'1.5.0'Details
Type
string
Propertyprotectedbool  $_dijitLoaderRegistered= 'false'

Has the dijit loader been registered?

Default valuefalseDetails
Type
bool
Propertyprotectedarray  $_dijits= 'array()'

Registered programmatic dijits

Default valuearray()Details
Type
array
Propertyprotectedarray  $_djConfig= 'array()'

Dojo configuration

Default valuearray()Details
Type
array
Propertyprotectedbool  $_enabled= 'false'

Whether or not dojo is enabled

Default valuefalseDetails
Type
bool
Propertyprotectedbool  $_isXhtml= 'false'

Are we rendering as XHTML?

Default valuefalseDetails
Type
bool
Propertyprotectedarray  $_javascriptStatements= 'array()'

Arbitrary javascript to include in dojo script

Default valuearray()Details
Type
array
Propertyprotectedarray  $_layers= 'array()'

Dojo layers (custom builds) to use

Default valuearray()Details
Type
array
Propertyprotectedstring  $_localPath= 'null'

Relative path to dojo

Default valuenullDetails
Type
string
Propertyprotectedstring  $_localRelativePath= 'null'

Root of dojo where all dojo files are installed

Default valuenullDetails
Type
string
Propertyprotectedarray  $_modulePaths= 'array()'

Registered module paths

Default valuearray()Details
Type
array
Propertyprotectedarray  $_modules= 'array()'

Modules to require

Default valuearray()Details
Type
array
Propertyprotectedarray  $_onLoadActions= 'array()'

Actions to perform on window load

Default valuearray()Details
Type
array
Propertyprotectedbool  $_registerDojoStylesheet= 'false'

Register the Dojo stylesheet?

Default valuefalseDetails
Type
bool
Propertyprotectedarray  $_stylesheetModules= 'array()'

Style sheet modules to load

Default valuearray()Details
Type
array
Propertyprotectedarray  $_stylesheets= 'array()'

Local stylesheets

Default valuearray()Details
Type
array
Propertyprotectedarray  $_zendLoadActions= 'array()'

Array of onLoad events specific to Zend_Dojo integration operations

Default valuearray()Details
Type
array
Propertypublic\Zend_View_Interface  $view= ''

Details
Type
\Zend_View_Interface

Methods

methodpublic__toString( ) : string

String representation of dojo environment

Returns
Type Description
string
methodpublic_addZendLoad( string $callback ) : \Zend_Dojo_View_Helper_Dojo_Container

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
Name Type Description
$callback string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodprotected_getLocalRelativePath( ) : string

Retrieve local path to dojo resources for building relative paths

Returns
Type Description
string
methodpublic_getZendLoadActions( ) : array

Retrieve all ZF dijit callbacks

Returns
Type Description
array
methodprotected_renderDjConfig( ) : string

Render DjConfig values

Returns
Type Description
string
methodprotected_renderDojoScriptTag( ) : string

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
Type Description
string
methodprotected_renderExtras( ) : string

Render dojo module paths and requires

Returns
Type Description
string
methodprotected_renderLayers( ) : string

Render layers (custom builds) as script tags

Returns
Type Description
string
methodprotected_renderStylesheets( ) : string

Render dojo stylesheets

Returns
Type Description
string
methodpublicaddDijit( string $id, array $params ) : \Zend_Dojo_View_Helper_Dojo_Container

Add a programmatic dijit

Parameters
Name Type Description
$id string
$params array
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicaddDijits( array $dijits ) : \Zend_Dojo_View_Helper_Dojo_Container

Add multiple dijits at once

Expects an array of id => array $params pairs

Parameters
Name Type Description
$dijits array
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicaddJavascript( string $js ) : \Zend_Dojo_View_Helper_Dojo_Container

Add arbitrary javascript to execute in dojo JS container

Parameters
Name Type Description
$js string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicaddLayer( string $path ) : \Zend_Dojo_View_Helper_Dojo_Container

Add layer (custom build) path

Parameters
Name Type Description
$path string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicaddOnLoad( string $callback ) : \Zend_Dojo_View_Helper_Dojo_Container

Add a script to execute onLoad

dojo.addOnLoad accepts: - function name - lambda

Parameters
Name Type Description
$callback string

Lambda

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicaddStylesheet( string $path ) : \Zend_Dojo_View_Helper_Dojo_Container

Add a stylesheet

Parameters
Name Type Description
$path string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicaddStylesheetModule( string $module ) : \Zend_Dojo_View_Helper_Dojo_Container

Add a stylesheet by module name

Parameters
Name Type Description
$module string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicclearDijits( ) : \Zend_Dojo_View_Helper_Dojo_Container

Clear all dijits

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicclearJavascript( ) : \Zend_Dojo_View_Helper_Dojo_Container

Clear arbitrary javascript stack

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicclearLayers( ) : \Zend_Dojo_View_Helper_Dojo_Container

Clear all registered layers

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicdijitsToJson( ) : string

Render dijits as JSON structure

Returns
Type Description
string
methodpublicdisable( ) : \Zend_Dojo_View_Helper_Dojo_Container

Disable dojo

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicenable( ) : \Zend_Dojo_View_Helper_Dojo_Container

Enable dojo

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicgetCdnBase( ) : string

Return CDN base URL

Returns
Type Description
string
methodpublicgetCdnDojoPath( ) : string

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

Returns
Type Description
string
methodpublicgetCdnVersion( ) : string

Get CDN version

Returns
Type Description
string
methodpublicgetDijit( string $id ) : array|null

Retrieve a dijit by id

Parameters
Name Type Description
$id string
Returns
Type Description
array|null
methodpublicgetDijits( ) : array

Retrieve all dijits

Returns dijits as an array of assoc arrays

Returns
Type Description
array
methodpublicgetDjConfig( ) : array

Retrieve dojo configuration values

Returns
Type Description
array
methodpublicgetDjConfigOption( string $option, mixed $default = null ) : mixed

Get dojo configuration value

Parameters
Name Type Description
$option string
$default mixed
Returns
Type Description
mixed
methodpublicgetJavascript( ) : array

Return all registered javascript statements

Returns
Type Description
array
methodpublicgetLayers( ) : array

Get registered layers

Returns
Type Description
array
methodpublicgetLocalPath( ) : string

Get local path to dojo

Returns
Type Description
string
methodpublicgetModulePaths( ) : array

List registered module paths

Returns
Type Description
array
methodpublicgetModules( ) : array

Retrieve list of modules to require

Returns
Type Description
array
methodpublicgetOnLoadActions( ) : array

Retrieve all registered onLoad actions

Returns
Type Description
array
methodpublicgetStylesheetModules( ) : array

Get all stylesheet modules currently registered

Returns
Type Description
array
methodpublicgetStylesheets( ) : array

Retrieve registered stylesheets

Returns
Type Description
array
methodpublichasDijit( string $id ) : bool

Is the given programmatic dijit already registered?

Parameters
Name Type Description
$id string
Returns
Type Description
bool
methodpublicisEnabled( ) : bool

Is dojo enabled?

Returns
Type Description
bool
methodpublicjavascriptCaptureEnd( ) : true

Finish capturing arbitrary javascript to include in dojo script

Returns
Type Description
true
methodpublicjavascriptCaptureStart( ) : void

Capture arbitrary javascript to include in dojo script

methodpubliconLoadCaptureEnd( ) : bool

Stop capturing routines to run onLoad

Returns
Type Description
bool
methodpubliconLoadCaptureStart( ) : bool

Start capturing routines to run onLoad

Returns
Type Description
bool
methodpublicprependOnLoad( string $callback ) : \Zend_Dojo_View_Helper_Dojo_Container

Prepend an onLoad event to the list of onLoad actions

Parameters
Name Type Description
$callback string

Lambda

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicregisterDijitLoader( ) : void

Create dijit loader functionality

methodpublicregisterDojoStylesheet( null|bool $flag = null ) : \Zend_Dojo_View_Helper_Dojo_Container|bool

Register the dojo.css stylesheet?

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

Parameters
Name Type Description
$flag null|bool
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container|bool
methodpublicregisterModulePath( string $module, string $path ) : \Zend_Dojo_View_Helper_Dojo_Container

Register a module path

Parameters
Name Type Description
$module string

The module to register a path for

$path string

The path to register for the module

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicremoveDijit( string $id ) : \Zend_Dojo_View_Helper_Dojo_Container

Remove a programmatic dijit if it exists

Parameters
Name Type Description
$id string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicremoveLayer( string $path ) : \Zend_Dojo_View_Helper_Dojo_Container

Remove a registered layer

Parameters
Name Type Description
$path string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicrequireModule( string|array $modules ) : \Zend_Dojo_View_Helper_Dojo_Container

Specify one or multiple modules to require

Parameters
Name Type Description
$modules string|array
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetCdnBase( string $url ) : \Zend_Dojo_View_Helper_Dojo_Container

Set CDN base path

Parameters
Name Type Description
$url string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetCdnDojoPath( string $path ) : \Zend_Dojo_View_Helper_Dojo_Container

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

Parameters
Name Type Description
$path string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetCdnVersion( string $version = null ) : \Zend_Dojo_View_Helper_Dojo_Container

Use CDN, using version specified

Parameters
Name Type Description
$version string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetDijit( string $id, array $params ) : \Zend_Dojo_View_Helper_Dojo_Container

Set a programmatic dijit (overwrites)

Parameters
Name Type Description
$id string
$params array
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetDijits( array $dijits ) : \Zend_Dojo_View_Helper_Dojo_Container

Set multiple dijits at once (overwrites)

Expects an array of id => array $params pairs

Parameters
Name Type Description
$dijits array
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetDjConfig(  $config ) : \Zend_Dojo_View_Helper_Dojo_Container

Set Dojo configuration

Parameters
Name Type Description
$config
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetDjConfigOption( string $option, mixed $value ) : \Zend_Dojo_View_Helper_Dojo_Container

Set Dojo configuration option

Parameters
Name Type Description
$option string
$value mixed
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetLocalPath( string $path ) : \Zend_Dojo_View_Helper_Dojo_Container

Set path to local dojo

Parameters
Name Type Description
$path string
Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetOptions( array|\Zend_Config $options ) : \Zend_Dojo_View_Helper_Dojo_Container

Add options for the Dojo Container to use

Parameters
Name Type Description
$options array|\Zend_Config

Array or Zend_Config object with options to use

Returns
Type Description
\Zend_Dojo_View_Helper_Dojo_Container
methodpublicsetView( \Zend_Dojo_View_Interface $view ) : void

Set view object

Parameters
Name Type Description
$view \Zend_Dojo_View_Interface
methodpublicuseCdn( ) : bool

Are we using the CDN?

Returns
Type Description
bool
methodpublicuseLocalPath( ) : bool

Are we using a local path?

Returns
Type Description
bool
Documentation was generated by DocBlox 0.15.1.