Class Zend_View_Helper_HeadScript

Description

Helper for setting and retrieving script elements for HTML head section

Located in /View/Helper/HeadScript.php (line 34)

Zend_View_Helper_Abstract
   |
   --Zend_View_Helper_Placeholder_Container_Standalone
      |
      --Zend_View_Helper_HeadScript
Direct descendents
Class Description
 class Zend_View_Helper_InlineScript Helper for setting and retrieving script elements for inclusion in HTML body section
Class Constant Summary
 FILE = 'FILE'
 SCRIPT = 'SCRIPT'
Variable Summary
Method Summary
 void __construct ()
 void append (string $value)
 void captureEnd ()
 void captureStart ([mixed $captureType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND], [ $type = 'text/javascript'], [ $attrs = array()], string $typeOrAttrs)
 stdClass createData (string $type,  $attributes, [string $content = null])
 Zend_View_Helper_HeadScript headScript ([string $mode = Zend_View_Helper_HeadScript::FILE], [string $spec = null], [string $placement = 'APPEND'], [ $attrs = array()], [string $type = 'text/javascript'])
 string itemToString ( $item, string|int $indent,  $escapeStart,  $escapeEnd, string $type, array $attributes, string $content)
 void offsetSet (string|int $index, mixed $value)
 void prepend (string $value)
 void set (string $value)
 string toString ([string|int $indent = null])
 bool _isDuplicate (string $file)
 bool _isValid (mixed $value, string $method)
 Zend_View_Helper_HeadScript __call (string $method, array $args)
Variables
bool $useCdata = false (line 85)

Whether or not to format scripts using CDATA; used only if doctype

helper is not accessible

  • access: public
bool $_arbitraryAttributes = false (line 54)

Are arbitrary attributes allowed?

  • access: protected
string $_captureLock (line 60)

Capture type and/or attributes (used for hinting during capture)

  • access: protected
string $_captureScriptAttrs = null (line 62)

Capture type and/or attributes (used for hinting during capture)

  • access: protected
string $_captureScriptType = null (line 61)

Capture type and/or attributes (used for hinting during capture)

  • access: protected
string $_captureType (line 63)

Capture type and/or attributes (used for hinting during capture)

  • access: protected
array $_optionalAttributes = array(
'charset', 'defer', 'language', 'src'
)
(line 70)

Optional allowed attributes for script tag

  • access: protected
string $_regKey = 'Zend_View_Helper_HeadScript' (line 48)

Registry key for placeholder

  • access: protected

Redefinition of:
Zend_View_Helper_Placeholder_Container_Standalone::$_regKey
Registry key under which container registers itself

Redefined in descendants as:
string $_requiredAttributes = array('type') (line 78)

Required attributes for script tag

  • access: protected

Inherited Variables

Inherited from Zend_View_Helper_Placeholder_Container_Standalone

Zend_View_Helper_Placeholder_Container_Standalone::$_autoEscape
Zend_View_Helper_Placeholder_Container_Standalone::$_container
Zend_View_Helper_Placeholder_Container_Standalone::$_registry

Inherited from Zend_View_Helper_Abstract

Zend_View_Helper_Abstract::$view
Methods
Constructor __construct (line 94)

Constructor

Set separator to PHP_EOL.

  • access: public
void __construct ()

Redefinition of:
Zend_View_Helper_Placeholder_Container_Standalone::__construct()
Constructor
append (line 303)

Override append

  • access: public
void append (string $value)
  • string $value
arbitraryAttributesAllowed (line 380)

Are arbitrary attributes allowed?

  • access: public
bool arbitraryAttributesAllowed ()
captureEnd (line 160)

End capture action and store

  • access: public
void captureEnd ()
captureStart (line 141)

Start capture action

  • access: public
void captureStart ([mixed $captureType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND], [ $type = 'text/javascript'], [ $attrs = array()], string $typeOrAttrs)
  • mixed $captureType
  • string $typeOrAttrs
  • $type
  • $attrs
createData (line 470)

Create data item containing all necessary components of script

  • access: public
stdClass createData (string $type,  $attributes, [string $content = null])
  • string $type
  • array $attributes
  • string $content
headScript (line 113)

Return headScript object

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

  • access: public
Zend_View_Helper_HeadScript headScript ([string $mode = Zend_View_Helper_HeadScript::FILE], [string $spec = null], [string $placement = 'APPEND'], [ $attrs = array()], [string $type = 'text/javascript'])
  • string $mode: Script or file
  • string $spec: Script/url
  • string $placement: Append, prepend, or set
  • array $attrs: Array of script attributes
  • string $type: Script type and/or array of script attributes
itemToString (line 394)

Create script HTML

  • access: public
string itemToString ( $item, string|int $indent,  $escapeStart,  $escapeEnd, string $type, array $attributes, string $content)
  • string $type
  • array $attributes
  • string $content
  • string|int $indent
  • $item
  • $escapeStart
  • $escapeEnd
offsetSet (line 352)

Override offsetSet

  • access: public
void offsetSet (string|int $index, mixed $value)
  • string|int $index
  • mixed $value

Redefinition of:
Zend_View_Helper_Placeholder_Container_Standalone::offsetSet()
ArrayAccess: offsetSet
prepend (line 319)

Override prepend

  • access: public
void prepend (string $value)
  • string $value
set (line 335)

Override set

  • access: public
void set (string $value)
  • string $value
setAllowArbitraryAttributes (line 369)

Set flag indicating if arbitrary attributes are allowed

  • access: public
Zend_View_Helper_HeadScript setAllowArbitraryAttributes (bool $flag)
  • bool $flag
toString (line 434)

Retrieve string representation

  • access: public
string toString ([string|int $indent = null])
  • string|int $indent

Redefinition of:
Zend_View_Helper_Placeholder_Container_Standalone::toString()
String representation
_isDuplicate (line 265)

Is the file specified a duplicate?

  • access: protected
bool _isDuplicate (string $file)
  • string $file
_isValid (line 285)

Is the script provided valid?

  • access: protected
bool _isValid (mixed $value, string $method)
  • mixed $value
  • string $method
__call (line 200)

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())

  • throws: Zend_View_Exception if too few arguments or invalid method
  • access: public
Zend_View_Helper_HeadScript __call (string $method, array $args)
  • string $method
  • array $args

Redefinition of:
Zend_View_Helper_Placeholder_Container_Standalone::__call()
Overload

Inherited Methods

Inherited From Zend_View_Helper_Placeholder_Container_Standalone

 Zend_View_Helper_Placeholder_Container_Standalone::__construct()
 Zend_View_Helper_Placeholder_Container_Standalone::count()
 Zend_View_Helper_Placeholder_Container_Standalone::getAutoEscape()
 Zend_View_Helper_Placeholder_Container_Standalone::getContainer()
 Zend_View_Helper_Placeholder_Container_Standalone::getIterator()
 Zend_View_Helper_Placeholder_Container_Standalone::getRegistry()
 Zend_View_Helper_Placeholder_Container_Standalone::offsetExists()
 Zend_View_Helper_Placeholder_Container_Standalone::offsetGet()
 Zend_View_Helper_Placeholder_Container_Standalone::offsetSet()
 Zend_View_Helper_Placeholder_Container_Standalone::offsetUnset()
 Zend_View_Helper_Placeholder_Container_Standalone::setAutoEscape()
 Zend_View_Helper_Placeholder_Container_Standalone::setContainer()
 Zend_View_Helper_Placeholder_Container_Standalone::setRegistry()
 Zend_View_Helper_Placeholder_Container_Standalone::toString()
 Zend_View_Helper_Placeholder_Container_Standalone::_escape()
 Zend_View_Helper_Placeholder_Container_Standalone::__call()
 Zend_View_Helper_Placeholder_Container_Standalone::__get()
 Zend_View_Helper_Placeholder_Container_Standalone::__isset()
 Zend_View_Helper_Placeholder_Container_Standalone::__set()
 Zend_View_Helper_Placeholder_Container_Standalone::__toString()
 Zend_View_Helper_Placeholder_Container_Standalone::__unset()

Inherited From Zend_View_Helper_Abstract

 Zend_View_Helper_Abstract::direct()
 Zend_View_Helper_Abstract::setView()
Class Constants
FILE = 'FILE' (line 40)

Script type contants

SCRIPT = 'SCRIPT' (line 41)

Script type contants

Documentation generated on Fri, 08 Jan 2010 16:16:41 -0500 by phpDocumentor 1.4.3