raintpl3
raintpl3 copied to clipboard
{loop} sanity checks
In the compiled code, {loop} tag produces pretty big if() with lots of checks to make sure that variable can be looped though. I think that these checks are unnecessary. It should be up to the developer to make sure it's an correct array (just like any other tag, where checks like that are not performed). I already removed that extra if() from my website, and it works just like I expect it to.
I partially agree, for back compatibility is better to keep it this way by default. Performances aren't a big issue.
We can consider to add a new configuration $conf['allow_empty_loop'], but that could be complex to make it work with the loop else tag.
From my iPhone
On Aug 8, 2013, at 1:35 PM, Pavel [email protected] wrote:
In the compiled code, {loop} tag produces pretty big if() with lots of checks to make sure that variable can be looped though. I think that these checks are unnecessary. It should be up to the developer to make sure it's an correct array (just like any other tag, where checks like that are not performed). I already removed that extra if() from my website, and it works just like I expect it to.
— Reply to this email directly or view it on GitHub.