Helper for setting and retrieving script elements for HTML head section

Allows the following method calls:

 Methods

Overload method access

__call(string $method, array $args) : \Zend\View\Helper\HeadScript

Proxy to container methods

Parameters

$method

string

Method to call

$args

array

Arguments of method

Exceptions

\Zend\View\Exception\BadMethodCallException if too few arguments or invalid method

Returns

Constructor

__construct() 

Set separator to PHP_EOL.

Overloading: retrieve property

__get(string $key) : mixed
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::__get()

Parameters

$key

string

Returns

mixed

Return headScript object

__invoke(string $mode, string $spec, string $placement, array $attrs, string $type) : \Zend\View\Helper\HeadScript

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

Overloading: check if property is set

__isset(string $key) : bool
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::__isset()

Parameters

$key

string

Returns

bool

Overloading: set property value

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

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::__set()

Parameters

$key

string

$value

mixed

Cast to string representation

__toString() : string
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::__toString()

Returns

string

Overloading: unset property

__unset(string $key) : void
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::__unset()

Parameters

$key

string

Override append

append(string $value) : void

Parameters

$value

string

Append script or file

Exceptions

\Zend\View\Exception\InvalidArgumentException

)

appendFile( $src, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$src

=

$type$attrs

=

$type$attrs

Returns

)

appendScript( $script, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$script

=

$type$attrs

=

$type$attrs

Returns

Are arbitrary attributes allowed?

arbitraryAttributesAllowed() : bool

Returns

bool

End capture action and store

captureEnd() : void

Start capture action

captureStart(mixed $captureType, string $type, array $attrs) : void

Parameters

$captureType

mixed

Type of capture

$type

string

Type of script

$attrs

array

Attributes of capture

Exceptions

\Zend\View\Exception\RuntimeException

Countable

count() : int
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::count()

Returns

int

Create data item containing all necessary components of script

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

Parameters

$type

string

Type of data

$attributes

array

Attributes of data

$content

string

Content of data

Returns

Delete a container

deleteContainer() : bool
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::deleteContainer()

Returns

bool

Return whether autoEscaping is enabled or disabled

getAutoEscape() 
Inherited

return bool

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::getAutoEscape()

Retrieve placeholder container

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

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::getContainer()

Returns

Retrieve the container class

getContainerClass() : string
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::getContainerClass()

Returns

string

Get Escaper instance

getEscaper(string | null $enc) : mixed
Inherited

Lazy-loads one if none available

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::getEscaper()

Parameters

$enc

stringnull

Encoding to use

Returns

mixed

IteratorAggregate: get Iterator

getIterator() : \Zend\View\Helper\Placeholder\Container\Iterator
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::getIterator()

Returns

\Zend\View\Helper\Placeholder\Container\Iterator

Get the view object

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

inherited_from \Zend\View\Helper\AbstractHelper::getView()
inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::getView()

Returns

Create script HTML

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

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 | int $offset) : bool
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::offsetExists()

Parameters

$offset

stringint

Returns

bool

ArrayAccess: offsetGet

offsetGet(string | int $offset) : mixed
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::offsetGet()

Parameters

$offset

stringint

Returns

mixed

Override offsetSet

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

Parameters

$index

stringint

Set script of file offset

$value

mixed

Exceptions

\Zend\View\Exception\InvalidArgumentException

)

offsetSetFile( $index,  $src, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$index

$src

=

$type$attrs

=

$type$attrs

Returns

)

offsetSetScript( $index,  $src, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$index

$src

=

$type$attrs

=

$type$attrs

Returns

ArrayAccess: offsetUnset

offsetUnset(string | int $offset) : void
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::offsetUnset()

Parameters

$offset

stringint

Override prepend

prepend(string $value) : void

Parameters

$value

string

Prepend script or file

Exceptions

\Zend\View\Exception\InvalidArgumentException

)

prependFile( $src, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$src

=

$type$attrs

=

$type$attrs

Returns

)

prependScript( $script, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$script

=

$type$attrs

=

$type$attrs

Returns

Override set

set(string $value) : void

Parameters

$value

string

Set script or file

Exceptions

\Zend\View\Exception\InvalidArgumentException

Set flag indicating if arbitrary attributes are allowed

setAllowArbitraryAttributes(bool $flag) : \Zend\View\Helper\HeadScript

Parameters

$flag

bool

Set flag

Returns

Set whether or not auto escaping should be used

setAutoEscape(bool $autoEscape) : \Zend\View\Helper\Placeholder\Container\AbstractStandalone
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::setAutoEscape()

Parameters

$autoEscape

bool

whether or not to auto escape output

Returns

Set container on which to operate

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

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::setContainer()

Parameters

Returns

Set the container class to use

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

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::setContainerClass()

Parameters

$name

string

Exceptions

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

Returns

Set Escaper instance

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

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::setEscaper()

Parameters

Returns

)

setFile( $src, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$src

=

$type$attrs

=

$type$attrs

Returns

)

setScript( $script, $type =, $attrs =) : \Zend\View\Helper\HeadScript

magic
method )

Parameters

$script

=

$type$attrs

=

$type$attrs

Returns

Set the View object

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

inherited_from \Zend\View\Helper\AbstractHelper::setView()
inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::setView()

Parameters

Returns

Retrieve string representation

toString(string | int $indent) : string

Parameters

$indent

stringint

Amount of whitespaces or string to use for indention

Returns

string

Escape a string

escape(string $string) : string
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::escape()

Parameters

$string

string

Returns

string

Is the file specified a duplicate?

isDuplicate(string $file) : bool

Parameters

$file

string

Name of file to check

Returns

bool

Is the script provided valid?

isValid(mixed $value) : bool

Parameters

$value

mixed

Is the given script valid?

Returns

bool

 Properties

 

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

$useCdata : bool

 

Are arbitrary attributes allowed?

$arbitraryAttributes : bool

 

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

$autoEscape : bool
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::$$autoEscape
 

Is capture lock?

$captureLock : bool

 

Capture attributes

$captureScriptAttrs : null | array

 

Capture type

$captureScriptType : string

 

Capture type (append, prepend, set)

$captureType : string

 

$container

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

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::$$container
 

Default container class

$containerClass : string
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::$$containerClass
 

$escapers

$escapers : \Zend\Escaper\Escaper[]
Inherited

inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::$$escapers
 

Optional allowed attributes for script tag

$optionalAttributes : array

 

Registry key for placeholder

$regKey : string

 

Required attributes for script tag

$requiredAttributes : string

 

View object instance

$view : \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::$$view
inherited_from \Zend\View\Helper\Placeholder\Container\AbstractStandalone::$$view

 Constants

 

Script type constants

FILE 

const string
 

SCRIPT

SCRIPT