Skip to content

Deprecation: script template helpers

Taylor Hunt edited this page Aug 2, 2019 · 3 revisions

<script template-helpers> and <script marko-init> are deprecated in favor of static and class blocks.

The old template-helpers attribute:

<script template-helpers>
   function sum(a, b) {
      return a + b;
   }
</script>

<output>The sum of 1 + 2 is ${sum(1, 2)}</output>

…is replaced with the static marker:

static function sum(a, b) {
   return a + b;
}

<output>The sum of 1 + 2 is ${sum(1, 2)}</output>

For more information on the change, see issue #547.