Spork Code Libraries

Dojo

Provides interface to configure Dojo framework and uses HeadLink and HeadScript view helpers to add framework to application.

Example Configuration array(

'dojo' => array(
    'async' => BOOLEAN,
    'debug' => BOOLEAN,
    'enabled' => BOOLEAN,
    'parseOnLoad' => BOOLEAN,
    'packages' => ARRAY('PACKAGE NAME', ...),
    'src' => 'URL',
)

)

Extends
\Zend\View\Helper\AbstractHelper
Implements

Properties

$async

$async : boolean

Load asynchronously

Type

boolean

$debug

$debug : boolean

Use debugging configuration

Type

boolean

$enabled

$enabled : boolean

Load Dojo flag

Type

boolean

$initialized

$initialized : boolean

Initialized flag

Type

boolean

$modules

$modules : array

List of modules to load

Type

array

$options

$options : array

List of options

Type

array

$packages

$packages : array

List of packages to load

Type

array

$parseOnLoad

$parseOnLoad : boolean

Parse on load flag

Type

boolean

$src

$src : string

Dojo source path

Type

string

Methods

__invoke()

__invoke(array  $options = null) : \Spork\View\Helper\Dojo

Initialize and configure instance

Parameters

array $options

Returns

\Spork\View\Helper\Dojo

createService()

createService(\Zend\ServiceManager\ServiceLocatorInterface  $viewHelperManager) : \Spork\View\Helper\Dojo

Create and configure service

Parameters

\Zend\ServiceManager\ServiceLocatorInterface $viewHelperManager

Returns

\Spork\View\Helper\Dojo
See also

isAsync()

isAsync() : boolean

Get asynchronous flag

Returns

boolean

setAsync()

setAsync(string  $flag = true) 

Set asynchronous flag

Parameters

string $flag

isDebug()

isDebug() : boolean

Get is debug flag

Returns

boolean

setDebug()

setDebug(string  $flag = true) 

Set debug flag

Parameters

string $flag

isEnabled()

isEnabled() : boolean

Get enabled flag

Returns

boolean

setEnabled()

setEnabled(string  $flag = true) 

Set enable flag

Parameters

string $flag

addModule()

addModule(string  $module) 

Add module

Parameters

string $module

setModules()

setModules(array  $modules) 

Parameters

array $modules

removeModule()

removeModule(\Spork\View\Helper\unknown  $module) 

Remove module

Parameters

\Spork\View\Helper\unknown $module

addPackage()

addPackage(string  $name, string  $location) 

Add package

Parameters

string $name
string $location

setPackages()

setPackages(array  $packages) 

Set package

Parameters

array $packages

removePackage()

removePackage(\Spork\View\Helper\unknown  $name) 

Remove package

Parameters

\Spork\View\Helper\unknown $name

getParseOnLoad()

getParseOnLoad() : boolean

Get parse on load flag

Returns

boolean

setParseOnLoad()

setParseOnLoad(string  $flag = true) 

Set parse on load flag

Parameters

string $flag

getSrc()

getSrc() : string

Get Dojo source path

Returns

string

setSrc()

setSrc(\Spork\View\Helper\unknown  $src) 

Set Dojo source path

Parameters

\Spork\View\Helper\unknown $src

config()

config(array  $options) 

Configure object

Parameters

array $options

initialize()

initialize() 

Add Dojo configuration to HeadScript. Should only be called once.

getSession()

getSession() : \Zend\Session\Container

Get session

Returns

\Zend\Session\Container

initializeOptions()

initializeOptions(array  $options) 

Initialize options

Parameters

array $options