Dojo/BuildLayer.php

Show: PublicProtectedPrivateinherited
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 [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Dojo  
Version
$Id$  

\Zend_Dojo_BuildLayer

Package: Zend_Dojo
Dojo module layer and custom build profile generation support
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedbool $_consumeJavascript = false
Flag: whether or not to consume JS aggregated in the dojo() view helper when generate the module layer contents
Default valuefalseDetails
Type
bool
>VPropertyprotectedbool $_consumeOnLoad = false
Flag: whether or not to consume dojo.addOnLoad events registered with the dojo() view helper when generating the module layer file contents
Default valuefalseDetails
Type
bool
>VPropertyprotected\Zend_Dojo_View_Helper_Dojo_Container $_dojo
Dojo view helper reference
>VPropertyprotectedstring $_layerName
Name of the custom layer to generate
Details
Type
string
>VPropertyprotectedstring $_layerScriptPath
Path to the custom layer script relative to dojo.js (used when creating the build profile)
Details
Type
string
>VPropertyprotectedarray $_profileOptions = array('action' => 'release', 'optimize' => 'shrinksafe', 'layerOptimize' => 'shrinksafe', 'copyTests' => false, 'loader' => 'default', 'cssOptimize' => 'comments')
Build profile options
Default valuearray('action' => 'release', 'optimize' => 'shrinksafe', 'layerOptimize' => 'shrinksafe', 'copyTests' => false, 'loader' => 'default', 'cssOptimize' => 'comments')Details
Type
array
>VPropertyprotectedarray $_profilePrefixes = array()
Associative array of module/path pairs for the build profile
Default valuearray()Details
Type
array
>VPropertyprotected\Zend_View_Interface $_view
Zend_View reference

Methods

methodpublic__construct(array | \Zend_Config $options = null) : void

Constructor

Parameters
NameTypeDescription
$optionsarray | \Zend_Config
Throws
ExceptionDescription
\Zend_Dojo_Exceptionfor invalid option argument
methodprotected_filterJsonProfileToJavascript(string $profile) : string

Filter a JSON build profile to JavaScript

Parameters
NameTypeDescription
$profilestring
Returns
TypeDescription
string
methodprotected_getPrefix(string $module) : void

Retrieve module prefix

Parameters
NameTypeDescription
$modulestring
methodpublicaddProfileOption(string $key, \value $value) : \Zend_Dojo_BuildLayer

Add a single build profile option

Parameters
NameTypeDescription
$keystring
$value\value
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicaddProfileOptions(array $options) : \Zend_Dojo_BuildLayer

Add many build profile options at once

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicaddProfilePrefix(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".
Parameters
NameTypeDescription
$prefixstring
$pathnull | string
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicclearProfileOptions() : \Zend_Dojo_BuildLayer

Remove all build profile options

Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicconsumeJavascript() : bool

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

Returns
TypeDescription
bool
methodpublicconsumeOnLoad() : bool

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

Returns
TypeDescription
bool
methodpublicgenerateBuildProfile() : string

Generate build profile

Returns
TypeDescription
string
methodpublicgenerateLayerScript() : string

Generate module layer script

Returns
TypeDescription
string
methodpublicgetDojoHelper() : \Zend_Dojo_View_Helper_Dojo_Container

Retrieve dojo() view helper instance

Will retrieve it from the view object if not registered.
Returns
TypeDescription
\Zend_Dojo_View_Helper_Dojo_Container
Throws
ExceptionDescription
\Zend_Dojo_Exceptionif not registered and no view object found
methodpublicgetLayerName() : string | null

Retrieve custom layer name

Returns
TypeDescription
string | null
methodpublicgetLayerScriptPath() : string | null

Get custom layer script path

Returns
TypeDescription
string | null
methodpublicgetProfileOption(string $key) : mixed

Retrieve a single build profile option

Returns null if profile option does not exist.
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
mixed
methodpublicgetProfileOptions() : array

Get all build profile options

Returns
TypeDescription
array
methodpublicgetProfilePrefixes() : array

Get build profile dependency prefixes

Returns
TypeDescription
array
methodpublicgetView() : \Zend_View_Interface | null

Retrieve view object

Returns
TypeDescription
\Zend_View_Interface | null
methodpublichasProfileOption(string $key) : bool

Is a given build profile option set?

Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
bool
methodpublicremoveProfileOption(string $name) : \Zend_Dojo_BuildLayer

Remove a build profile option

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetConsumeJavascript(bool $flag) : \Zend_Dojo_BuildLayer

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

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetConsumeOnLoad(bool $flag) : \Zend_Dojo_BuildLayer

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

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetDojoHelper(\Zend_Dojo_View_Helper_Dojo_Container $helper) : \Zend_Dojo_BuildLayer

Set dojo() view helper instance

Parameters
NameTypeDescription
$helper\Zend_Dojo_View_Helper_Dojo_Container
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetLayerName(string $name) : \Zend_Dojo_BuildLayer

Set custom layer name; e.g. "custom.main"

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetLayerScriptPath(string $path) : \Zend_Dojo_BuildLayer

Set the path to the custom layer script

Should be a path relative to dojo.js
Parameters
NameTypeDescription
$pathstring
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetOptions(array $options) : \Zend_Dojo_BuildLayer

Set options

Proxies to any setter that matches an option key.
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetProfileOptions(array $options) : \Zend_Dojo_BuildLayer

Set many build profile options at once

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetProfilePrefixes(array $prefixes) : \Zend_Dojo_BuildLayer

Set multiple dependency prefixes for bulid profile

Parameters
NameTypeDescription
$prefixesarray
Returns
TypeDescription
\Zend_Dojo_BuildLayer
methodpublicsetView(\Zend_View_Interface $view) : \Zend_Dojo_BuildLayer

Set View object

Parameters
NameTypeDescription
$view\Zend_View_Interface
Returns
TypeDescription
\Zend_Dojo_BuildLayer
Documentation was generated by phpDocumentor 2.2.0 .