You are here: Nested foreach-statements in templates « PHP Programming Language « IT news, forums, messages
Nested foreach-statements in templates

Posted by Sam on 11/15/07 08:34

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:categories,category}
{foreach:category,thing}
<htmltags>{thing->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
http://www.akbkhome.com/blog.php/View/121/Getting_Started_with_HTML_FlexyFramework_DataObjects_and_HTML_Template_Flexy.html
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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация