Difference between template and script



What is difference between template and script, if both are evaluated by the scripting engine? one difference is that script can return value from a variable, template is for text manipulations, anything else that i am missing?

<script return=“var”/>

which is the preferred way to get value and why?


I suggest you can think template tag as printf in Java. Lets say if var=3, in case of template “The value is ${var}” returns “The value is 3”. (it substitutes the value)
Whereas script return only returns value from the script, it returns only 3 from the script in this case.

Hope this helps!