diff --git a/CHANGELOG.md b/CHANGELOG.md index c0fbfa6b..c963e07f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,12 @@ All notable changes to this project will be documented in this file, in reverse ### Added - [#89](https://github.com/zendframework/zend-view/pull/89) updates the - `HeadScript` view helper to whitelist the `id` attribute as an optional - attribute. + `HeadScript` and `InlineScript` view helpers to whitelist the `id` attribute + as an optional attribute. + +- [#96](https://github.com/zendframework/zend-view/pull/96) updates the + `HeadScript`, `HeadLink`, and `InlineScript` view helpers to whitelist the + `crossorigin` and `integrity` attributes as optional attributes. ### Deprecated diff --git a/doc/book/helpers/head-link.md b/doc/book/helpers/head-link.md index 4595ae88..7ef1ea08 100644 --- a/doc/book/helpers/head-link.md +++ b/doc/book/helpers/head-link.md @@ -8,10 +8,10 @@ elements for later retrieval and output in your layout script. The `HeadLink` helper has special methods for adding stylesheet links to its stack: -- `appendStylesheet($href, $media, $conditionalStylesheet, $extras)` -- `offsetSetStylesheet($index, $href, $media, $conditionalStylesheet, $extras)` -- `prependStylesheet($href, $media, $conditionalStylesheet, $extras)` -- `setStylesheet($href, $media, $conditionalStylesheet, $extras)` +- `appendStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])` +- `offsetSetStylesheet($index, $href, $media = 'screen', $conditionalStylesheet = '', $extras = [])` +- `prependStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])` +- `setStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])` The `$media` value defaults to 'screen', but may be any valid media value. `$conditionalStylesheet` is a string or boolean `false`, and will be used at @@ -22,10 +22,10 @@ extra values that you want to be added to the tag. Additionally, the `HeadLink` helper has special methods for adding 'alternate' links to its stack: -- `appendAlternate($href, $type, $title, $extras)` -- `offsetSetAlternate($index, $href, $type, $title, $extras)` -- `prependAlternate($href, $type, $title, $extras)` -- `setAlternate($href, $type, $title, $extras)` +- `appendAlternate($href, $type, $title, $extras = [])` +- `offsetSetAlternate($index, $href, $type, $title, $extras = [])` +- `prependAlternate($href, $type, $title, $extras = [])` +- `setAlternate($href, $type, $title, $extras = [])` The `headLink()` helper method allows specifying all attributes necessary for a `` element, and allows you to also specify placement: whether the diff --git a/doc/book/helpers/head-script.md b/doc/book/helpers/head-script.md index 130b0bdd..2e615d06 100644 --- a/doc/book/helpers/head-script.md +++ b/doc/book/helpers/head-script.md @@ -6,14 +6,14 @@ code. The `HeadScript` helper allows you to manage both. The `HeadScript` helper supports the following methods for setting and adding scripts: -- `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, $script, $type = 'text/javascript', $attrs = array())` -- `prependScript($script, $type = 'text/javascript', $attrs = array())` -- `setScript($script, $type = 'text/javascript', $attrs = array())` +- `appendFile($src, $type = 'text/javascript', $attrs = [])` +- `offsetSetFile($index, $src, $type = 'text/javascript', $attrs = [])` +- `prependFile($src, $type = 'text/javascript', $attrs = [])` +- `setFile($src, $type = 'text/javascript', $attrs = [])` +- `appendScript($script, $type = 'text/javascript', $attrs = [])` +- `offsetSetScript($index, $script, $type = 'text/javascript', $attrs = [])` +- `prependScript($script, $type = 'text/javascript', $attrs = [])` +- `setScript($script, $type = 'text/javascript', $attrs = [])` In the case of the `*File()` methods, `$src` is the remote location of the script to load; this is usually in the form of a URL or a path. For the @@ -86,8 +86,9 @@ The `HeadScript` helper is a concrete implementation of the > ### Arbitrary Attributes are Disabled by Default > > By default, `HeadScript` only will render `