Nested foreach-statements in templates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sam

    Nested foreach-statements in templates

    Have been trying to do this in flexy for a while, but it does not seem
    to support it. I have an array of categories of which each contains an
    array of things. So I'd like the template to look like this.
    {foreach:catego ries,category}
    {foreach:catego ry,thing}
    <htmltags>{thin g->someField}</htmltags>...
    {end:}
    {end:}
    Now it seems that flexy does not translate any flexy "statements "
    inside a foreach-statement. So it does not work in this way.
    The poster here http://pear.php.net/bugs/bug.php?id=3024 seems to say
    it's supposed to work, but he does not seem entirely sure.
    In steps 10 and 11 here

    the writer says that it does not work with templates and he recommends
    putting in a method that spits out html-tagged data. This makes it a
    bit more difficult to tell what the end result is going to be by
    reading only the template. Although I'll probably go for this approach
    now.
    Just wondered if anyone knew if it's still possible to do it with
    flexy somehow. Or if another template engine supports it.
Working...