Zend\View\Helper\HeadScript
Helper for setting and retrieving script elements for HTML head section
Allows the following method calls:
Synopsis
class HeadScript
extends AbstractStandalone
{
- // constants
- const FILE = 'FILE';
- const SCRIPT = 'SCRIPT';
- // members
- protected string $regKey;
- protected bool $arbitraryAttributes;
- protected bool $captureLock;
- protected string $captureScriptType;
- protected null|array $captureScriptAttrs;
- protected string $captureType;
- protected array $optionalAttributes;
- protected array $requiredAttributes;
- public bool $useCdata;
- // Inherited members from AbstractStandalone
- protected bool $autoEscape;
- protected AbstractContainer $container;
- protected string $containerClass;
- protected array $escapers;
- // Inherited members from AbstractHelper
- protected RendererInterface $view;
- // methods
- public void __construct()
- public HeadScript __invoke()
- public HeadScript __call()
- public string toString()
- public void captureStart()
- public void captureEnd()
- public stdClass createData()
- protected bool isDuplicate()
- protected bool isValid()
- public string itemToString()
- public void append()
- public void prepend()
- public void set()
- public void offsetSet()
- public HeadScript setAllowArbitraryAttributes()
- public bool arbitraryAttributesAllowed()
- // Inherited methods from AbstractStandalone
- public void __construct()
- public mixed __call()
- public void __set()
- public mixed __get()
- public bool __isset()
- public void __unset()
- public string __toString()
- public string toString()
- protected string escape()
- public AbstractStandalone setAutoEscape()
- public void getAutoEscape()
- public AbstractStandalone setContainer()
- public AbstractContainer getContainer()
- public bool deleteContainer()
- public AbstractStandalone setContainerClass()
- public string getContainerClass()
- public AbstractStandalone setEscaper()
- public mixed getEscaper()
- public int count()
- public bool offsetExists()
- public mixed offsetGet()
- public void offsetSet()
- public void offsetUnset()
- public Iterator getIterator()
- // Inherited methods from AbstractHelper
- public AbstractHelper setView()
- public null|Renderer getView()
Hierarchy
Extends
Extended by
Constants
Name | Value |
---|---|
FILE | 'FILE' |
SCRIPT | 'SCRIPT' |
Members
protected
- $arbitraryAttributes
—
Zend\View\Helper\bool
Are arbitrary attributes allowed? - $autoEscape
—
Zend\View\Helper\Placeholder\Container\bool
Flag whether to automatically escape output, must also be enforced in the child class if __toString/toString is overridden - $captureLock
—
Zend\View\Helper\bool
Is capture lock? - $captureScriptAttrs
—
Zend\View\Helper\null|array
Capture attributes - $captureScriptType
—
string
Capture type - $captureType
—
string
Capture type (append, prepend, set) - $container — Zend\View\Helper\Placeholder\Container\AbstractContainer
- $containerClass
—
string
Default container class - $escapers — array
- $optionalAttributes
—
array
Optional allowed attributes for script tag - $regKey
—
string
Registry key for placeholder - $requiredAttributes
—
string
Required attributes for script tag - $view
—
Zend\View\Renderer\RendererInterface
View object instance
public
- $useCdata
—
Zend\View\Helper\bool
Whether or not to format scripts using CDATA; used only if doctype helper is not accessible
Methods
protected
- isDuplicate() — Is the file specified a duplicate?
- isValid() — Is the script provided valid?
public
- __construct() — Constructor
- __call() — Overload method access
- __invoke() — Return headScript object
- append() — Override append
- arbitraryAttributesAllowed() — Are arbitrary attributes allowed?
- captureEnd() — End capture action and store
- captureStart() — Start capture action
- createData() — Create data item containing all necessary components of script
- itemToString() — Create script HTML
- offsetSet() — Override offsetSet
- prepend() — Override prepend
- set() — Override set
- setAllowArbitraryAttributes() — Set flag indicating if arbitrary attributes are allowed
- toString() — Retrieve string representation
Inherited from Zend\View\Helper\Placeholder\Container\AbstractStandalone
protected
- escape() — Escape a string
public
- __call() — Overload
- __get() — Overloading: retrieve property
- __isset() — Overloading: check if property is set
- __set() — Overloading: set property value
- __toString() — Cast to string representation
- __unset() — Overloading: unset property
- count() — Countable
- deleteContainer() — Delete a container
- getAutoEscape() — Return whether autoEscaping is enabled or disabled
- getContainer() — Retrieve placeholder container
- getContainerClass() — Retrieve the container class
- getEscaper() — Get Escaper instance
- getIterator() — IteratorAggregate: get Iterator
- offsetExists() — ArrayAccess: offsetExists
- offsetGet() — ArrayAccess: offsetGet
- offsetSet() — ArrayAccess: offsetSet
- offsetUnset() — ArrayAccess: offsetUnset
- setAutoEscape() — Set whether or not auto escaping should be used
- setContainer() — Set container on which to operate
- setContainerClass() — Set the container class to use
- setEscaper() — Set Escaper instance
- toString() — String representation