Quote:
Originally Posted by RichieRich
Ah ok thanks mike, I was wondering the same thing, shame it can't be done in the template like before
|
Not really. Yes it's a bit of a pain when looking for the quick fix. But the separation of logic from presentation is the holy grail of program design.
With Smarty(XC4 template engine), we got some of that separation, but not nearly enough. I'm not a mind reader, but if I put myself in the position of the devs behind Flexy (XC5 template engine); I can see them being determined to not let Flexy turn into the mess that Smarty did.
Smarty gave designers too much power. And so rather than learn some PHP or bring in a dev, they just implemented some code in Smarty that "took care of it". Even if "taking care of it" meant 20 nested foreach loops.
This is the better way. But the learning curve is frightful for some.
A real world example of how this is better, even from a designer's standpoint: Now you have truncated the product name in 20 different templates with a Smarty call to {$product.name|truncate:30:"...":true}. And your client says "What the heck are those three dots at the end? I want those removed". You now have 20 edits to make. With a PHP method/function it's just one change.
Yeah I may be reaching with this example, but it demonstrates the point perhaps.