Welcome Guest, Not a member yet? Register   Sign In
Parse data in model then send string back or parse data in final template.
#1

[eluser]Unknown[/eluser]
Hi all, quick question.

Do you reckon it is better to run the parser (twig) prior to sending the data back to the final output?
or send the data as array to the final output and let the final parser do the work?

IE:
In Final template output:

Code:
{% for var in items %}
codeoutput
{% endfor %}

or

Code:
{{ var }}
which runs the parser in a foreach loop on a snippet of html code in the model and returns the data parsed as a string.




Theme © iAndrew 2016 - Forum software by © MyBB