Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_View_Helper_HeadScript Class Reference

Public Member Functions

 __construct ()
 Constructor.
 
 headScript ($mode=Zend_View_Helper_HeadScript::FILE, $spec=null, $placement= 'APPEND', array $attrs=array(), $type= 'text/javascript')
 Return headScript object.
 
 captureStart ($captureType=Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $type= 'text/javascript', $attrs=array())
 Start capture action.
 
 captureEnd ()
 End capture action and store.
 
 __call ($method, $args)
 Overload method access.
 
 append ($value)
 Override append.
 
 prepend ($value)
 Override prepend.
 
 set ($value)
 Override set.
 
 offsetSet ($index, $value)
 Override offsetSet.
 
 setAllowArbitraryAttributes ($flag)
 Set flag indicating if arbitrary attributes are allowed.
 
 arbitraryAttributesAllowed ()
 Are arbitrary attributes allowed?
 
 itemToString ($item, $indent, $escapeStart, $escapeEnd)
 Create script HTML.
 
 toString ($indent=null)
 Retrieve string representation.
 
 createData ($type, array $attributes, $content=null)
 Create data item containing all necessary components of script.
 
- Public Member Functions inherited from Zend_View_Helper_Placeholder_Container_Standalone
 __construct ()
 Constructor.
 
 getRegistry ()
 Retrieve registry.
 
 setRegistry (Zend_View_Helper_Placeholder_Registry $registry)
 Set registry object.
 
 setAutoEscape ($autoEscape=true)
 Set whether or not auto escaping should be used.
 
 getAutoEscape ()
 Return whether autoEscaping is enabled or disabled.
 
 setContainer (Zend_View_Helper_Placeholder_Container_Abstract $container)
 Set container on which to operate.
 
 getContainer ()
 Retrieve placeholder container.
 
 __set ($key, $value)
 Overloading: set property value.
 
 __get ($key)
 Overloading: retrieve property.
 
 __isset ($key)
 Overloading: check if property is set.
 
 __unset ($key)
 Overloading: unset property.
 
 __call ($method, $args)
 Overload.
 
 toString ()
 String representation.
 
 __toString ()
 Cast to string representation.
 
 count ()
 Countable.
 
 offsetExists ($offset)
 ArrayAccess: offsetExists.
 
 offsetGet ($offset)
 ArrayAccess: offsetGet.
 
 offsetSet ($offset, $value)
 ArrayAccess: offsetSet.
 
 offsetUnset ($offset)
 ArrayAccess: offsetUnset.
 
 getIterator ()
 IteratorAggregate: get Iterator.
 
- Public Member Functions inherited from Zend_View_Helper_Abstract
 setView (Zend_View_Interface $view)
 Set the View object.
 
 direct ()
 Strategy pattern: currently unutilized.
 

Public Attributes

const FILE = 'FILE'
 #@+ Script type contants string
 
const SCRIPT = 'SCRIPT'
 
 $useCdata = false
 

Protected Member Functions

 _isDuplicate ($file)
 Is the file specified a duplicate?
 
 _isValid ($value)
 Is the script provided valid?
 
- Protected Member Functions inherited from Zend_View_Helper_Placeholder_Container_Standalone
 _escape ($string)
 Escape a string.
 

Protected Attributes

 $_regKey = 'Zend_View_Helper_HeadScript'
 
 $_arbitraryAttributes = false
 
 $_captureLock
 
 $_captureScriptType = null
 
 $_captureScriptAttrs = null
 
 $_captureType
 
 $_optionalAttributes
 
 $_requiredAttributes = array('type')
 
- Protected Attributes inherited from Zend_View_Helper_Placeholder_Container_Standalone
 $_container
 
 $_registry
 
 $_regKey
 
 $_autoEscape = true
 

Constructor & Destructor Documentation

__construct ( )

Constructor.

Set separator to PHP_EOL.

Returns
void

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
_isDuplicate (   $file)
protected

Is the file specified a duplicate?

Parameters
string$file
Returns
bool
_isValid (   $value)
protected

Is the script provided valid?

Parameters
mixed$value
string$method
Returns
bool
append (   $value)

Override append.

Parameters
string$value
Returns
void
arbitraryAttributesAllowed ( )

Are arbitrary attributes allowed?

Returns
bool
captureEnd ( )

End capture action and store.

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

Start capture action.

Parameters
mixed$captureType
string$typeOrAttrs
Returns
void
createData (   $type,
array  $attributes,
  $content = null 
)

Create data item containing all necessary components of script.

Parameters
string$type
array$attributes
string$content
Returns
stdClass
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
itemToString (   $item,
  $indent,
  $escapeStart,
  $escapeEnd 
)

Create script HTML.

Parameters
string$type
array$attributes
string$content
string | int$indent
Returns
string
offsetSet (   $index,
  $value 
)

Override offsetSet.

Parameters
string | int$index
mixed$value
Returns
void
prepend (   $value)

Override prepend.

Parameters
string$value
Returns
void
set (   $value)

Override set.

Parameters
string$value
Returns
void
setAllowArbitraryAttributes (   $flag)

Set flag indicating if arbitrary attributes are allowed.

Parameters
bool$flag
Returns
Zend_View_Helper_HeadScript
toString (   $indent = null)

Retrieve string representation.

Parameters
string | int$indent
Returns
string

Member Data Documentation

$_arbitraryAttributes = false
protected
$_captureLock
protected
$_captureScriptAttrs = null
protected
$_captureScriptType = null
protected
$_captureType
protected
$_optionalAttributes
protected
Initial value:
= array(
'charset', 'defer', 'language', 'src'
)
$_regKey = 'Zend_View_Helper_HeadScript'
protected
$_requiredAttributes = array('type')
protected
$useCdata = false
const FILE = 'FILE'

#@+ Script type contants string

const SCRIPT = 'SCRIPT'