Helper for setting and retrieving script elements for inclusion in HTML body section

Allows the following method calls:

package Default
inherited_from \Zend\View\Helper\HeadScript

 Methods

Overload

__call(string $method, array $args) : mixed
Inherited

Proxy to container methods

Parameters

$method

string

$args

array

Exceptions

\Zend\View\Exception\BadMethodCallException

Returns

mixed

Constructor

__construct() 
Inherited

Overloading: retrieve property

__get(string $key) : mixed
Inherited

Parameters

$key

string

Returns

mixed

Return InlineScript object

__invoke(string $mode = self::FILE, string $spec = null, string $placement = 'APPEND', array $attrs = array(), string $type = 'text/javascript') : \Zend\View\Helper\InlineScript

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

inherited_from \Zend\View\Helper\HeadScript::__invoke()

Parameters

$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

\Zend\View\Helper\InlineScript

Return headScript object

__invoke(string $mode = self::FILE, string $spec = null, string $placement = 'APPEND', array $attrs = array(), string $type = 'text/javascript') : \Zend\View\Helper\HeadScript
Inherited

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

Parameters

$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

\Zend\View\Helper\HeadScript

Overloading: check if property is set

__isset(string $key) : boolean
Inherited

Parameters

$key

string

Returns

boolean

Overloading: set property value

__set(string $key, mixed $value) : void
Inherited

Parameters

$key

string

$value

mixed

Cast to string representation

__toString() : string
Inherited

Returns

string

Overloading: unset property

__unset(string $key) : void
Inherited

Parameters

$key

string

Override append

append(string $value) : void
Inherited

Parameters

$value

string

Append script or file

Exceptions

\Zend\View\Exception\InvalidArgumentException

Are arbitrary attributes allowed?

arbitraryAttributesAllowed() : boolean
Inherited

Returns

boolean

End capture action and store

captureEnd() : void
Inherited

Start capture action

captureStart(mixed $captureType = \Zend\View\Helper\Placeholder\Container\AbstractContainer::APPEND, string $type = 'text/javascript', array $attrs = array()) : void
Inherited

Parameters

$captureType

mixed

Type of capture

$type

string

Type of script

$attrs

array

Attributes of capture

Exceptions

\Zend\View\Exception\RuntimeException

Countable

count() : integer
Inherited

Returns

integer

Create data item containing all necessary components of script

createData(string $type, array $attributes, string $content = null) : \stdClass
Inherited

Parameters

$type

string

Type of data

$attributes

array

Attributes of data

$content

string

Content of data

Returns

\stdClass

Delete a container

deleteContainer() : boolean
Inherited

Returns

boolean

Return whether autoEscaping is enabled or disabled

getAutoEscape() 
Inherited

return bool

Retrieve placeholder container

getContainer() : \Zend\View\Helper\Placeholder\Container\AbstractContainer
Inherited

Returns

\Zend\View\Helper\Placeholder\Container\AbstractContainer

Retrieve the container class

getContainerClass() : string
Inherited

Returns

string

Get Escaper instance

getEscaper(string|null $enc = 'UTF-8') : mixed
Inherited

Lazy-loads one if none available

Parameters

$enc

stringnull

Encoding to use

Returns

mixed

IteratorAggregate: get Iterator

getIterator() : \Iterator
Inherited

Returns

\Iterator

Get the view object

getView() : null | \Zend\View\Renderer\RendererInterface
Inherited
inherited_from \Zend\View\Helper\HelperInterface::getView()

Returns

null\Zend\View\Renderer\RendererInterface

Create script HTML

itemToString(mixed $item, string $indent, string $escapeStart, string $escapeEnd) : string
Inherited

Parameters

$item

mixed

Item to convert

$indent

string

String to add before the item

$escapeStart

string

Starting sequence

$escapeEnd

string

Ending sequence

Returns

string

ArrayAccess: offsetExists

offsetExists(string|integer $offset) : boolean
Inherited

Parameters

$offset

stringinteger

Returns

boolean

ArrayAccess: offsetGet

offsetGet(string|integer $offset) : mixed
Inherited

Parameters

$offset

stringinteger

Returns

mixed

ArrayAccess: offsetSet

offsetSet(string|integer $offset, mixed $value) : void
Inherited

Parameters

$offset

stringinteger

$value

mixed

ArrayAccess: offsetUnset

offsetUnset(string|integer $offset) : void
Inherited

Parameters

$offset

stringinteger

Override prepend

prepend(string $value) : void
Inherited

Parameters

$value

string

Prepend script or file

Exceptions

\Zend\View\Exception\InvalidArgumentException

Override set

set(string $value) : void
Inherited

Parameters

$value

string

Set script or file

Exceptions

\Zend\View\Exception\InvalidArgumentException

Set flag indicating if arbitrary attributes are allowed

setAllowArbitraryAttributes(boolean $flag) : \Zend\View\Helper\HeadScript
Inherited

Parameters

$flag

boolean

Set flag

Returns

\Zend\View\Helper\HeadScript

Set whether or not auto escaping should be used

setAutoEscape(boolean $autoEscape = true) : \Zend\View\Helper\Placeholder\Container\AbstractStandalone
Inherited

Parameters

$autoEscape

boolean

whether or not to auto escape output

Returns

\Zend\View\Helper\Placeholder\Container\AbstractStandalone

Set container on which to operate

setContainer(\Zend\View\Helper\Placeholder\Container\AbstractContainer $container) : \Zend\View\Helper\Placeholder\Container\AbstractStandalone
Inherited

Parameters

$container

\Zend\View\Helper\Placeholder\Container\AbstractContainer

Returns

\Zend\View\Helper\Placeholder\Container\AbstractStandalone

Set the container class to use

setContainerClass(string $name) : \Zend\View\Helper\Placeholder\Container\AbstractStandalone
Inherited

Parameters

$name

string

Exceptions

\Zend\View\Exception\InvalidArgumentException
\Zend\View\Exception\DomainException

Returns

\Zend\View\Helper\Placeholder\Container\AbstractStandalone

Set Escaper instance

setEscaper(\Zend\Escaper\Escaper $escaper) : \Zend\View\Helper\Placeholder\Container\AbstractStandalone
Inherited

Parameters

$escaper

\Zend\Escaper\Escaper

Returns

\Zend\View\Helper\Placeholder\Container\AbstractStandalone

Set the View object

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited
inherited_from \Zend\View\Helper\HelperInterface::setView()

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

\Zend\View\Helper\AbstractHelper

String representation

toString() : string
Inherited

Returns

string

Escape a string

escape(string $string) : string
Inherited

Parameters

$string

string

Returns

string

Is the file specified a duplicate?

isDuplicate(string $file) : boolean
Inherited

Parameters

$file

string

Name of file to check

Returns

boolean

Is the script provided valid?

isValid(mixed $value) : boolean
Inherited

Parameters

$value

mixed

Is the given script valid?

Returns

boolean

 Properties

 

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

$useCdata : boolean

Default

false
 

Are arbitrary attributes allowed?

$arbitraryAttributes : boolean

Default

false
 

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

$autoEscape : boolean

Default

true
 

Is capture lock?

$captureLock : boolean

Default

 

Capture attributes

$captureScriptAttrs : null | array

Default

null
 

Capture type

$captureScriptType : string

Default

 

Capture type (append, prepend, set)

$captureType : string

Default

 

$container

$container : \Zend\View\Helper\Placeholder\Container\AbstractContainer

Default

 

Default container class

$containerClass : string

Default

'Zend\View\Helper\Placeholder\Container'
 

$escapers

$escapers : array<mixed,\Zend\Escaper\Escaper>

Default

array()
 

Optional allowed attributes for script tag

$optionalAttributes : array

Default

array('charset', 'crossorigin', 'defer', 'language', 'src')
 

Registry key for placeholder

$regKey : string

Default

'Zend_View_Helper_InlineScript'
inherited_from \Zend\View\Helper\HeadScript::regKey
 

Registry key for placeholder

$regKey : string

Default

'Zend_View_Helper_HeadScript'
 

Required attributes for script tag

$requiredAttributes : string

Default

array('type')
 

View object instance

$view : \Zend\View\Renderer\RendererInterface

Default

null

 Constants

 

Script type constants

FILE = 'FILE' 
const string
 

SCRIPT

SCRIPT = 'SCRIPT'