Zend Framework
3.0
|
Helper for setting and retrieving script elements for HTML head section. More...
Public Member Functions | |
__construct () | |
Constructor. | |
__invoke ($mode=self::FILE, $spec=null, $placement= 'APPEND', array $attrs=[], $type= 'text/javascript') | |
Return headScript object. | |
__call ($method, $args) | |
Overload method access. | |
toString ($indent=null) | |
Retrieve string representation. | |
captureStart ($captureType=Placeholder\Container\AbstractContainer::APPEND, $type= 'text/javascript', $attrs=[]) | |
Start capture action. | |
captureEnd () | |
End capture action and store. | |
createData ($type, array $attributes, $content=null) | |
Create data item containing all necessary components of script. | |
itemToString ($item, $indent, $escapeStart, $escapeEnd) | |
Create script HTML. | |
append ($value) | |
Override append. | |
prepend ($value) | |
Override prepend. | |
set ($value) | |
Override set. | |
offsetSet ($index, $value) | |
Override offsetSet. | |
setAllowArbitraryAttributes ($flag) | |
Set flag indicating if arbitrary attributes are allowed. | |
arbitraryAttributesAllowed () | |
Are arbitrary attributes allowed? | |
Public Member Functions inherited from AbstractStandalone | |
__construct () | |
Constructor. | |
__call ($method, $args) | |
Overload. | |
__set ($key, $value) | |
Overloading: set property value. | |
__get ($key) | |
Overloading: retrieve property. | |
__isset ($key) | |
Overloading: check if property is set. | |
__unset ($key) | |
Overloading: unset property. | |
__toString () | |
Cast to string representation. | |
toString () | |
String representation. | |
setAutoEscape ($autoEscape=true) | |
Set whether or not auto escaping should be used. | |
getAutoEscape () | |
Return whether autoEscaping is enabled or disabled. | |
setContainer (AbstractContainer $container) | |
Set container on which to operate. | |
getContainer () | |
Retrieve placeholder container. | |
deleteContainer () | |
Delete a container. | |
setContainerClass ($name) | |
Set the container class to use. | |
getContainerClass () | |
Retrieve the container class. | |
setEscaper (Escaper $escaper) | |
Set Escaper instance. | |
getEscaper ($enc= 'UTF-8') | |
Get Escaper instance. | |
count () | |
Countable. | |
offsetExists ($offset) | |
ArrayAccess: offsetExists. | |
offsetGet ($offset) | |
ArrayAccess: offsetGet. | |
offsetSet ($offset, $value) | |
ArrayAccess: offsetSet. | |
offsetUnset ($offset) | |
ArrayAccess: offsetUnset. | |
getIterator () | |
IteratorAggregate: get Iterator. | |
Public Member Functions inherited from AbstractHelper | |
setView (Renderer $view) | |
Set the View object. | |
getView () | |
Get the view object. | |
Public Attributes | |
const | FILE = 'FILE' |
Script type constants. | |
const | SCRIPT = 'SCRIPT' |
$useCdata = false | |
Protected Member Functions | |
isDuplicate ($file) | |
Is the file specified a duplicate? | |
isValid ($value) | |
Is the script provided valid? | |
Protected Member Functions inherited from AbstractStandalone | |
escape ($string) | |
Escape a string. | |
Protected Attributes | |
$regKey = 'Zend_View_Helper_HeadScript' | |
$arbitraryAttributes = false | |
$captureLock | |
$captureScriptType | |
$captureScriptAttrs = null | |
$captureType | |
$optionalAttributes | |
$requiredAttributes = ['type'] | |
Protected Attributes inherited from AbstractStandalone | |
$autoEscape = true | |
$container | |
$containerClass = 'Zend\View\Helper\Placeholder\Container' | |
$escapers = [] | |
Protected Attributes inherited from AbstractHelper | |
$view = null | |
Helper for setting and retrieving script elements for HTML head section.
Allows the following method calls: HeadScript appendFile($src, $type = 'text/javascript', $attrs = array()) HeadScript offsetSetFile($index, $src, $type = 'text/javascript', $attrs = array()) HeadScript prependFile($src, $type = 'text/javascript', $attrs = array()) HeadScript setFile($src, $type = 'text/javascript', $attrs = array()) HeadScript appendScript($script, $type = 'text/javascript', $attrs = array()) HeadScript offsetSetScript($index, $src, $type = 'text/javascript', $attrs = array()) HeadScript prependScript($script, $type = 'text/javascript', $attrs = array()) HeadScript setScript($script, $type = 'text/javascript', $attrs = array())
__construct | ( | ) |
Constructor.
Set separator to PHP_EOL.
__call | ( | $method, | |
$args | |||
) |
Overload method access.
string | $method | Method to call |
array | $args | Arguments of method |
Exception\BadMethodCallException | if too few arguments or invalid method |
__invoke | ( | $mode = self::FILE , |
|
$spec = null , |
|||
$placement = 'APPEND' , |
|||
array | $attrs = [] , |
||
$type = 'text/javascript' |
|||
) |
Return headScript object.
Returns headScript helper object; optionally, allows specifying a script or script file to include.
string | $mode | Script or file |
string | $spec | Script/url |
string | $placement | Append, prepend, or set |
array | $attrs | Array of script attributes |
string | $type | Script type and/or array of script attributes |
append | ( | $value | ) |
Override append.
string | $value | Append script or file |
Exception\InvalidArgumentException |
arbitraryAttributesAllowed | ( | ) |
Are arbitrary attributes allowed?
captureEnd | ( | ) |
End capture action and store.
captureStart | ( | $captureType = Placeholder\Container\AbstractContainer::APPEND , |
|
$type = 'text/javascript' , |
|||
$attrs = [] |
|||
) |
Start capture action.
mixed | $captureType | Type of capture |
string | $type | Type of script |
array | $attrs | Attributes of capture |
Exception\RuntimeException |
createData | ( | $type, | |
array | $attributes, | ||
$content = null |
|||
) |
Create data item containing all necessary components of script.
string | $type | Type of data |
array | $attributes | Attributes of data |
string | $content | Content of data |
|
protected |
Is the file specified a duplicate?
string | $file | Name of file to check |
|
protected |
Is the script provided valid?
mixed | $value | Is the given script valid? |
itemToString | ( | $item, | |
$indent, | |||
$escapeStart, | |||
$escapeEnd | |||
) |
Create script HTML.
mixed | $item | Item to convert |
string | $indent | String to add before the item |
string | $escapeStart | Starting sequence |
string | $escapeEnd | Ending sequence |
offsetSet | ( | $index, | |
$value | |||
) |
Override offsetSet.
string | int | $index | Set script of file offset |
mixed | $value |
Exception\InvalidArgumentException |
prepend | ( | $value | ) |
Override prepend.
string | $value | Prepend script or file |
Exception\InvalidArgumentException |
set | ( | $value | ) |
Override set.
string | $value | Set script or file |
Exception\InvalidArgumentException |
setAllowArbitraryAttributes | ( | $flag | ) |
Set flag indicating if arbitrary attributes are allowed.
bool | $flag | Set flag |
toString | ( | $indent = null | ) |
Retrieve string representation.
string | int | $indent | Amount of whitespaces or string to use for indention |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
$useCdata = false |
const FILE = 'FILE' |
Script type constants.
string
const SCRIPT = 'SCRIPT' |