Helper for setting and retrieving script elements for HTML head section

package Zend_View
subpackage Helper

 Methods

Overload method access

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

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

$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

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

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

Get Escaper instance

getEscaper($enc) : mixed
Inherited

Lazy-loads one if none available

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

Parameters

$enc

Returns

mixed

IteratorAggregate: get Iterator

getIterator() : \Iterator
Inherited

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

Returns

\Iterator

Retrieve registry

getRegistry() : \Zend\View\Helper\Placeholder\Registry
Inherited

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

Returns

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

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

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

Set registry object

setRegistry(\Zend\View\Helper\Placeholder\Registry $registry) : \Zend\View\Helper\Placeholder\Container\AbstractStandalone
Inherited

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

Parameters

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
 

$captureLock

$captureLock 

 

$captureScriptAttrs

$captureScriptAttrs 

 

$captureScriptType

$captureScriptType 

 

$captureType

$captureType 

 

$container

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

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

$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

 

$registry

$registry : \Zend\View\Helper\Placeholder\Registry
Inherited

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

Required attributes for script tag

$requiredAttributes : string

 

View object

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

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

 Constants

 

FILE

FILE 

 

SCRIPT

SCRIPT