Helper for setting and retrieving script elements for inclusion in HTML body
section
Allows the following method calls:
Methods
Overload method access
__call(string $method, array $args) : \Zend\View\Helper\HeadScript
Inherited
Proxy to container methods
inherited_from |
\Zend\View\Helper\HeadScript::__call() |
Parameters
$method
string
Method to call
$args
array
Arguments of method
Exceptions
Returns
Constructor
__construct()
Inherited
Set separator to PHP_EOL.
inherited_from |
\Zend\View\Helper\HeadScript::__construct() |
Overloading: retrieve property
__get(string $key) : mixed
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::__get() |
inherited_from |
\Zend\View\Helper\HeadScript::__get() |
Parameters
$key
string
Returns
mixed
Return InlineScript object
__invoke(string $mode, string $spec, string $placement, array $attrs, string $type) : \Zend\View\Helper\InlineScript
Returns InlineScript helper object; optionally, allows specifying a
script or script file to include.
Parameters
$mode
string
Script or file
$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() |
inherited_from |
\Zend\View\Helper\HeadScript::__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() |
inherited_from |
\Zend\View\Helper\HeadScript::__set() |
Parameters
$key
string
$value
mixed
Cast to string representation
__toString() : string
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::__toString() |
inherited_from |
\Zend\View\Helper\HeadScript::__toString() |
Returns
string
Overloading: unset property
__unset(string $key) : void
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::__unset() |
inherited_from |
\Zend\View\Helper\HeadScript::__unset() |
Parameters
$key
string
Override append
append(string $value) : void
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::append() |
Parameters
$value
string
Append script or file
Exceptions
Are arbitrary attributes allowed?
arbitraryAttributesAllowed() : bool
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::arbitraryAttributesAllowed() |
Returns
bool
End capture action and store
captureEnd() : void
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::captureEnd() |
Start capture action
captureStart(mixed $captureType, string $type, array $attrs) : void
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::captureStart() |
Parameters
$captureType
mixed
Type of capture
$type
string
Type of script
$attrs
array
Attributes of capture
Exceptions
Countable
count() : int
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::count() |
inherited_from |
\Zend\View\Helper\HeadScript::count() |
Returns
int
Create data item containing all necessary components of script
createData(string $type, array $attributes, string $content) : \stdClass
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::createData() |
Parameters
$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() |
inherited_from |
\Zend\View\Helper\HeadScript::deleteContainer() |
Returns
bool
Return whether autoEscaping is enabled or disabled
getAutoEscape()
Inherited
return bool
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::getAutoEscape() |
inherited_from |
\Zend\View\Helper\HeadScript::getAutoEscape() |
Retrieve the container class
getContainerClass() : string
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::getContainerClass() |
inherited_from |
\Zend\View\Helper\HeadScript::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() |
inherited_from |
\Zend\View\Helper\HeadScript::getEscaper() |
Parameters
$enc
stringnull
Encoding to use
Returns
mixed
IteratorAggregate: get Iterator
getIterator() : \Iterator
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::getIterator() |
inherited_from |
\Zend\View\Helper\HeadScript::getIterator() |
Returns
\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() |
inherited_from |
\Zend\View\Helper\HeadScript::getView() |
Returns
Create script HTML
itemToString(mixed $item, string $indent, string $escapeStart, string $escapeEnd) : string
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::itemToString() |
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() |
inherited_from |
\Zend\View\Helper\HeadScript::offsetExists() |
Parameters
$offset
stringint
Returns
bool
ArrayAccess: offsetGet
offsetGet(string | int $offset) : mixed
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::offsetGet() |
inherited_from |
\Zend\View\Helper\HeadScript::offsetGet() |
Parameters
$offset
stringint
Returns
mixed
Override offsetSet
offsetSet(string | int $index, mixed $value) : void
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::offsetSet() |
Parameters
$index
stringint
Set script of file offset
$value
mixed
Exceptions
ArrayAccess: offsetUnset
offsetUnset(string | int $offset) : void
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::offsetUnset() |
inherited_from |
\Zend\View\Helper\HeadScript::offsetUnset() |
Parameters
$offset
stringint
Override prepend
prepend(string $value) : void
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::prepend() |
Parameters
$value
string
Prepend script or file
Exceptions
Override set
set(string $value) : void
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::set() |
Parameters
$value
string
Set script or file
Exceptions
Set flag indicating if arbitrary attributes are allowed
setAllowArbitraryAttributes(bool $flag) : \Zend\View\Helper\HeadScript
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::setAllowArbitraryAttributes() |
Parameters
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() |
inherited_from |
\Zend\View\Helper\HeadScript::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() |
inherited_from |
\Zend\View\Helper\HeadScript::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() |
inherited_from |
\Zend\View\Helper\HeadScript::setContainerClass() |
Parameters
$name
string
Exceptions
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() |
inherited_from |
\Zend\View\Helper\HeadScript::setEscaper() |
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() |
inherited_from |
\Zend\View\Helper\HeadScript::setView() |
Parameters
Returns
Retrieve string representation
toString(string | int $indent) : string
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::toString() |
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() |
inherited_from |
\Zend\View\Helper\HeadScript::escape() |
Parameters
$string
string
Returns
string
Is the file specified a duplicate?
isDuplicate(string $file) : bool
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::isDuplicate() |
Parameters
$file
string
Name of file to check
Returns
bool
Is the script provided valid?
isValid(mixed $value) : bool
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::isValid() |
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
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$useCdata |
Are arbitrary attributes allowed?
$arbitraryAttributes : bool
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$arbitraryAttributes |
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 |
inherited_from |
\Zend\View\Helper\HeadScript::$$autoEscape |
Is capture lock?
$captureLock : bool
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$captureLock |
Capture attributes
$captureScriptAttrs : null | array
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$captureScriptAttrs |
Capture type
$captureScriptType : string
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$captureScriptType |
Capture type (append, prepend, set)
$captureType : string
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$captureType |
Default container class
$containerClass : string
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::$$containerClass |
inherited_from |
\Zend\View\Helper\HeadScript::$$containerClass |
$escapers
$escapers : \Zend\Escaper\Escaper[]
Inherited
inherited_from |
\Zend\View\Helper\Placeholder\Container\AbstractStandalone::$$escapers |
inherited_from |
\Zend\View\Helper\HeadScript::$$escapers |
Optional allowed attributes for script tag
$optionalAttributes : array
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$optionalAttributes |
Registry key for placeholder
$regKey : string
Required attributes for script tag
$requiredAttributes : string
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::$$requiredAttributes |
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 |
inherited_from |
\Zend\View\Helper\HeadScript::$$view |
Constants
Script type constants
FILE
Inherited
const |
string |
inherited_from |
\Zend\View\Helper\HeadScript::FILE |
SCRIPT
SCRIPT
Inherited
inherited_from |
\Zend\View\Helper\HeadScript::SCRIPT |