View/Helper/HeadScript.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_View  
Subpackage
Helper  
Version
$Id: HeadScript.php 24960 2012-06-15 14:09:34Z adamlundrigan $  

\Zend_View_Helper_HeadScript

Package: Zend\View\Helper

Helper for setting and retrieving script elements for HTML head section

Parent(s)
\Zend_View_Helper_Placeholder_Container_Standalone < \Zend_View_Helper_Abstract
Children
\Zend_View_Helper_InlineScript
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
\global\Zend_View_Helper_Placeholder_Container_Standalone  

Constants

Constant  FILE = 'FILE'
Constant  SCRIPT = 'SCRIPT'

Properties

Propertyprotectedbool $_arbitraryAttributes = false

Are arbitrary attributes allowed?

Default valuefalseDetails
Type
bool
Propertyprotected\book $_autoEscape = true
inherited

Flag wheter to automatically escape output, must also be enforced in the child class if __toString/toString is overriden

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::$$_autoEscape
Default valuetrueDetails
Type
\book
Inherited_from
\Zend_View_Helper_Placeholder_Container_Standalone::$$_autoEscape  
Propertyprotected$_captureLock =
Details
Type
n/a
Propertyprotected$_captureScriptAttrs = null
Default valuenullDetails
Type
n/a
Propertyprotected$_captureScriptType = null
Default valuenullDetails
Type
n/a
Propertyprotected$_captureType =
Details
Type
n/a
Propertyprotected\Zend_View_Helper_Placeholder_Container_Abstract $_container =
Propertyprotectedarray $_optionalAttributes = array('charset', 'defer', 'language', 'src')

Optional allowed attributes for script tag

Default valuearray('charset', 'defer', 'language', 'src')Details
Type
array
Propertyprotectedstring $_regKey = 'Zend_View_Helper_HeadScript'

Registry key for placeholder

Default value'Zend_View_Helper_HeadScript'Details
Type
string
Propertyprotected\Zend_View_Helper_Placeholder_Registry $_registry =
Propertyprotectedstring $_requiredAttributes = array('type')

Required attributes for script tag

Default valuearray('type')Details
Type
string
Propertypublicbool $useCdata = false

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

Default valuefalseDetails
Type
bool
Propertypublic\Zend_View_Interface $view = null

Methods

methodpublic__call(string $method, array $args) : \Zend_View_Helper_HeadScript

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
Name Type Description
$method string
$args array
Returns
Type Description
\Zend_View_Helper_HeadScript
Throws
Exception Description
\Zend_View_Exception if too few arguments or invalid method
methodpublic__construct() : void

Constructor

Set separator to PHP_EOL.

methodpublic__get(string $key) : mixed
inherited

Overloading: retrieve property

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::__get()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublic__isset(string $key) : bool
inherited

Overloading: check if property is set

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::__isset()
Parameters
Name Type Description
$key string
Returns
Type Description
bool
methodpublic__set(string $key, mixed $value) : void
inherited

Overloading: set property value

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::__set()
Parameters
Name Type Description
$key string
$value mixed
methodpublic__toString() : string
inherited

Cast to string representation

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::__toString()
Returns
Type Description
string
methodpublic__unset(string $key) : void
inherited

Overloading: unset property

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::__unset()
Parameters
Name Type Description
$key string
methodprotected_escape(string $string) : string
inherited

Escape a string

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::_escape()
Parameters
Name Type Description
$string string
Returns
Type Description
string
methodprotected_isDuplicate(string $file) : bool

Is the file specified a duplicate?

Parameters
Name Type Description
$file string
Returns
Type Description
bool
methodprotected_isValid(mixed $value) : bool

Is the script provided valid?

Parameters
Name Type Description
$value mixed
Returns
Type Description
bool
methodpublicappend(string $value) : void

Override append

Parameters
Name Type Description
$value string
methodpublicarbitraryAttributesAllowed() : bool

Are arbitrary attributes allowed?

Returns
Type Description
bool
methodpubliccaptureEnd() : void

End capture action and store

methodpubliccaptureStart(mixed $captureType = \Zend_View_Helper_Placeholder_Container_Abstract::APPEND,  $type = 'text/javascript',  $attrs = array()) : void

Start capture action

Parameters
Name Type Description
$captureType mixed
$type
$attrs
methodpubliccount() : int
Returns
Type Description
int
methodpubliccreateData(string $type, array $attributes, string $content = null) : \stdClass

Create data item containing all necessary components of script

Parameters
Name Type Description
$type string
$attributes array
$content string
Returns
Type Description
\stdClass
methodpublicdirect() : void
inherited

Strategy pattern: currently unutilized

Inherited from: \Zend_View_Helper_Abstract::direct()\Zend_View_Helper_Placeholder_Container_Standalone::direct()
methodpublicgetAutoEscape() : void
inherited

Return whether autoEscaping is enabled or disabled

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::getAutoEscape()

return bool

methodpublicgetIterator() : \Iterator
inherited

IteratorAggregate: get Iterator

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::getIterator()
Returns
Type Description
\Iterator
methodpublicheadScript(string $mode = \Zend_View_Helper_HeadScript::FILE, string $spec = null, string $placement = 'APPEND', array $attrs = array(), string $type = 'text/javascript') : \Zend_View_Helper_HeadScript

Return headScript object

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

Parameters
Name Type Description
$mode string

Script or file

$spec string

Script/url

$placement string

Append, prepend, or set

$attrs array

Array of script attributes

$type string

Script type and/or array of script attributes

Returns
Type Description
\Zend_View_Helper_HeadScript
methodpublicitemToString( $item, string | int $indent,  $escapeStart,  $escapeEnd) : string

Create script HTML

Parameters
Name Type Description
$item
$indent string | int
$escapeStart
$escapeEnd
Returns
Type Description
string
methodpublicoffsetExists(string | int $offset) : bool
inherited

ArrayAccess: offsetExists

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::offsetExists()
Parameters
Name Type Description
$offset string | int
Returns
Type Description
bool
methodpublicoffsetGet(string | int $offset) : mixed
inherited

ArrayAccess: offsetGet

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::offsetGet()
Parameters
Name Type Description
$offset string | int
Returns
Type Description
mixed
methodpublicoffsetSet(string | int $index, mixed $value) : void

Override offsetSet

Parameters
Name Type Description
$index string | int
$value mixed
methodpublicoffsetUnset(string | int $offset) : void
inherited

ArrayAccess: offsetUnset

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::offsetUnset()
Parameters
Name Type Description
$offset string | int
methodpublicprepend(string $value) : void

Override prepend

Parameters
Name Type Description
$value string
methodpublicset(string $value) : void

Override set

Parameters
Name Type Description
$value string
methodpublicsetAllowArbitraryAttributes(bool $flag) : \Zend_View_Helper_HeadScript

Set flag indicating if arbitrary attributes are allowed

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_View_Helper_HeadScript
methodpublicsetAutoEscape(bool $autoEscape = true) : \Zend_View_Helper_Placeholder_Container_Standalone
inherited

Set whether or not auto escaping should be used

Inherited from: \Zend_View_Helper_Placeholder_Container_Standalone::setAutoEscape()
Parameters
Name Type Description
$autoEscape bool

whether or not to auto escape output

Returns
Type Description
\Zend_View_Helper_Placeholder_Container_Standalone
methodpublicsetView(\Zend_View_Interface $view) : \Zend_View_Helper_Abstract
Parameters
Name Type Description
$view \Zend_View_Interface
Returns
Type Description
\Zend_View_Helper_Abstract
methodpublictoString(string | int $indent = null) : string

Retrieve string representation

Parameters
Name Type Description
$indent string | int
Returns
Type Description
string
Documentation was generated by phpDocumentor 2.0.0a8.