473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Nested foreach-statements in templates

Sam
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/Vie...ate_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.
Nov 15 '07 #1
0 3756

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: SideByEach | last post by:
I've got a schema loaded into a XmlSchema class. Via the elements collection I can see all the elements defiend at the root of the schema. How can I get the definition of a nested schema element? ...
8
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. ...
0
by: R Reyes | last post by:
Hi. I'm trying to make some event handlers for buttons that are nested within datalists, however I keep getting errors trying to access them and a blank page shows w/o any real error message. How...
6
by: Andrew Matthews | last post by:
Hi All, I have the following little class of iterators that allow me to iterate over elements in the file system. I have nested some of them, and then added Func<FileInfo, booldelegates to filter...
2
by: bill | last post by:
All, Can anyone supply an example or reference to an example of using reflection to determine the data types contained in a nested stucture in C#? Once I get the list of MemberInfo and determine...
1
by: =?Utf-8?B?SmVyZW15X0I=?= | last post by:
I am working on an order entry program and have a question related to deserializing nodes with nested elements. The purchase order contains multiple line items which I select using an...
2
by: gezerpunta | last post by:
Hi I used pear api to make this mail but I can t add multipart.My mail structure is like that. part 1: a file part 2: multipart part 1: a file part 2: a file
1
by: levidicom | last post by:
foreach($test as $var1){ foreach($test2 as $var2) { echo '"var1: " . $var1 . "<br>"var2: " . $var2 . "<br> \n"'; }
1
by: levidicom | last post by:
foreach($test as $var1){ foreach($test2 as $var2) { echo '"var1: " . $var1 . "<br>"var2: " . $var2 . "<br> \n"'; }
1
by: TSmith | last post by:
Hey Y'all, I haven't programmed in PHP in quite a while. Could anyone help me with a foreach loop in a nested array? I have a function which returns $stock (for an online pricing catalog). ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.