问题
I'm new to smarty templates but is it possible to do recursion in the actual template vs throughout a php custom smarty function?
Example please.
Any Advice appreciated!
回答1:
See if this link helps you
http://www.smarty.net/forums/viewtopic.php?t=291
In short, it might be possible, but isn't the best idea. Recursion when not handled properly can lead to a lot of trouble and template engines aren't designed for recursion.
回答2:
You can do recursive templates through {include} and {function}. For the latter, Recursive menu {function} example exitst.
来源:https://stackoverflow.com/questions/9562709/php-smarty-recursion