Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes

Zend_View_Helper_HeadScript Class Reference

Inheritance diagram for Zend_View_Helper_HeadScript:
Zend_View_Helper_Placeholder_Container_Standalone Zend_View_Helper_Abstract Zend_View_Helper_Interface Zend_View_Helper_InlineScript

Public Member Functions

 __construct ()
 headScript ($mode=Zend_View_Helper_HeadScript::FILE, $spec=null, $placement= 'APPEND', array $attrs=array(), $type= 'text/javascript')
 captureStart ($captureType=Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $type= 'text/javascript', $attrs=array())
 captureEnd ()
 __call ($method, $args)
 append ($value)
 prepend ($value)
 set ($value)
 offsetSet ($index, $value)
 setAllowArbitraryAttributes ($flag)
 arbitraryAttributesAllowed ()
 itemToString ($item, $indent, $escapeStart, $escapeEnd)
 toString ($indent=null)
 createData ($type, array $attributes, $content=null)

Data Fields

const FILE = 'FILE'
const SCRIPT = 'SCRIPT'
 $useCdata = false

Protected Member Functions

 _isDuplicate ($file)
 _isValid ($value)

Protected Attributes

 $_regKey = 'Zend_View_Helper_HeadScript'
 $_arbitraryAttributes = false
 $_captureLock
 $_captureScriptType = null
 $_captureScriptAttrs = null
 $_captureType
 $_optionalAttributes
 $_requiredAttributes = array('type')

Detailed Description

Definition at line 35 of file HeadScript.php.


Constructor & Destructor Documentation

__construct (  )

Constructor

Set separator to PHP_EOL.

Returns:
void

Reimplemented from Zend_View_Helper_Placeholder_Container_Standalone.

Definition at line 95 of file HeadScript.php.


Member Function Documentation

__call ( method,
args 
)

Overload method access

Allows the following method calls:

  • appendFile($src, $type = 'text/javascript', $attrs = array())
  • offsetSetFile($index, $src, $type = 'text/javascript', $attrs = array())
  • prependFile($src, $type = 'text/javascript', $attrs = array())
  • setFile($src, $type = 'text/javascript', $attrs = array())
  • appendScript($script, $type = 'text/javascript', $attrs = array())
  • offsetSetScript($index, $src, $type = 'text/javascript', $attrs = array())
  • prependScript($script, $type = 'text/javascript', $attrs = array())
  • setScript($script, $type = 'text/javascript', $attrs = array())
Parameters:
string$method
array$args
Returns:
Zend_View_Helper_HeadScript
Exceptions:
Zend_View_Exceptionif too few arguments or invalid method

Reimplemented from Zend_View_Helper_Placeholder_Container_Standalone.

Definition at line 201 of file HeadScript.php.

_isDuplicate ( file ) [protected]

Is the file specified a duplicate?

Parameters:
string$file
Returns:
bool

Definition at line 266 of file HeadScript.php.

_isValid ( value ) [protected]

Is the script provided valid?

Parameters:
mixed$value
string$method
Returns:
bool

Definition at line 286 of file HeadScript.php.

append ( value )

Override append

Parameters:
string$value
Returns:
void

Definition at line 304 of file HeadScript.php.

arbitraryAttributesAllowed (  )

Are arbitrary attributes allowed?

Returns:
bool

Definition at line 381 of file HeadScript.php.

captureEnd (  )

End capture action and store

Returns:
void

Definition at line 161 of file HeadScript.php.

captureStart ( captureType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND,
type = 'text/javascript',
attrs = array() 
)

Start capture action

Parameters:
mixed$captureType
string$typeOrAttrs
Returns:
void

Definition at line 142 of file HeadScript.php.

createData ( type,
array $  attributes,
content = null 
)

Create data item containing all necessary components of script

Parameters:
string$type
array$attributes
string$content
Returns:
stdClass

Definition at line 471 of file HeadScript.php.

headScript ( mode = Zend_View_Helper_HeadScript::FILE,
spec = null,
placement = 'APPEND',
array $  attrs = array(),
type = 'text/javascript' 
)

Return headScript object

Returns headScript helper object; optionally, allows specifying a script or script file to include.

Parameters:
string$modeScript or file
string$specScript/url
string$placementAppend, prepend, or set
array$attrsArray of script attributes
string$typeScript type and/or array of script attributes
Returns:
Zend_View_Helper_HeadScript

Definition at line 114 of file HeadScript.php.

itemToString ( item,
indent,
escapeStart,
escapeEnd 
)

Create script HTML

Parameters:
string$type
array$attributes
string$content
string | int$indent
Returns:
string

Definition at line 395 of file HeadScript.php.

offsetSet ( index,
value 
)

Override offsetSet

Parameters:
string | int$index
mixed$value
Returns:
void

Reimplemented from Zend_View_Helper_Placeholder_Container_Standalone.

Definition at line 353 of file HeadScript.php.

prepend ( value )

Override prepend

Parameters:
string$value
Returns:
void

Definition at line 320 of file HeadScript.php.

set ( value )

Override set

Parameters:
string$value
Returns:
void

Definition at line 336 of file HeadScript.php.

setAllowArbitraryAttributes ( flag )

Set flag indicating if arbitrary attributes are allowed

Parameters:
bool$flag
Returns:
Zend_View_Helper_HeadScript

Definition at line 370 of file HeadScript.php.

toString ( indent = null )

Retrieve string representation

Parameters:
string | int$indent
Returns:
string

Definition at line 435 of file HeadScript.php.


Field Documentation

$_optionalAttributes [protected]
Initial value:
 array(
        'charset', 'defer', 'language', 'src'
    )

Definition at line 71 of file HeadScript.php.

const FILE = 'FILE'

#@+ Script type contants string

Definition at line 41 of file HeadScript.php.


The documentation for this class was generated from the following file: