File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,13 +127,6 @@ Routing
127127 enum backed properties as route parameters. When an enum backed property is
128128 used in routing, the enum's ``value `` or ``name `` will be used.
129129
130- Validation
131- ----------
132-
133- - ``ipOrRange() `` validation has has been added to check for an IP or a range (subnet).
134- - When validating within CakePHP marshalling context, the entity will be passed into the ``context `` argument for use inside custom validation rules.
135- This can be useful when patching partially and then needing to get that data from the entity instead of the passed data.
136-
137130TestSuite
138131---------
139132
@@ -146,3 +139,18 @@ Utility
146139- ``Text::uuid() `` now supports configurable UUID generation. You can set a custom
147140 UUID generator using ``Configure::write('Text.uuidGenerator', $closure) `` to
148141 integrate your own UUID generation strategy or third-party libraries.
142+
143+ Validation
144+ ----------
145+
146+ - ``ipOrRange() `` validation has has been added to check for an IP or a range (subnet).
147+ - When validating within CakePHP marshalling context, the entity will be passed into the ``context `` argument for use inside custom validation rules.
148+ This can be useful when patching partially and then needing to get that data from the entity instead of the passed data.
149+
150+ View
151+ ----
152+
153+ - :php:meth: `HtmlHelper::scriptStart() ` and ``scriptEnd() `` now allow simple
154+ wrapping script tags (``<script>...</script> ``) around inline JavaScript. This
155+ enables syntax highlighting in many editors to work. The wrapping script tag
156+ will be removed and replaced with a script tag generated by the helper.
Original file line number Diff line number Diff line change @@ -555,12 +555,30 @@ or buffered into a block::
555555 echo "alert('I am in the JavaScript');";
556556 $this->Html->scriptEnd();
557557
558+ You can use simple ``<script>...</script> `` tags inside the script block to
559+ enable syntax highlighting and LSP support in many editors::
560+
561+ <?php $this->Html->scriptStart(['block' => true]) ?>
562+ <script>
563+ document.addEventListener('DOMContentLoaded', function() {
564+ alert('I am in the JavaScript');
565+ });
566+ </script>
567+ <?php $this->Html->scriptEnd() ?>
568+
569+ The wrapping ``script``tag will be removed and replaced with a script tag
570+ generated by the helper that includes a CSP nonce if available.
571+
558572Once you have buffered javascript, you can output it as you would any other
559573:ref:`View Block <view-blocks>`::
560574
561575 // In your layout
562576 echo $this->fetch('script');
563577
578+ .. versionchanged:: 5.3.0
579+ Support for ``script `` tags inside ``scriptStart() ``/``scriptEnd() `` was
580+ added.
581+
564582Creating Javascript Importmap
565583-----------------------------
566584
You can’t perform that action at this time.
0 commit comments