PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_Template_Flexy » Bug #6212

can't use foreach with a method call

Details

Request #6212can't use foreach with a method call
Submitted2005-12-09 17:20 UTC
Fromkoeglstefan at gmx dot at
Assignedalan_k
StatusClosed
PackageHTML_Template_Flexy
PHP Version5.0.5
OSGentoo Linux
Roadmaps(Not assigned)

Comments

[2005-12-09 17:20 UTC] koeglstefan at gmx dot at

Description:
------------
Using a foreach-loop with a method call which returns a array in the form
{foreach:object.method(),var}
returns the following error

Parse error: parse error, unexpected '}' in /tmp/flexy_compiled_templates/<path>/info.html.en.php on line 18

Test script:
---------------
{foreach:object.method(),var}
{do_something()}
{end:}

[2005-12-14 22:18 UTC] mkliewe at gmx dot de

Would be nice if it will be added. I know the documentation only says that there should be a variable, but in the construct

<tr flexy:foreach="object.getMethod(),m">
<td></td>
</tr>

the documentation also says there should be a variable, but in that case the method-call is working. So it cannot be too hard to get a method-call in a "normal" foreach-loop working.

[2006-06-22 09:33 UTC] jan at motubo dot com

i agree with stefan, its annoying to can't use method calls within {foreach...}.

tried to patch this - the tokenizer does the parsing, right? its nearly impossible to patch this "cryptic" code for anyone who has not wrote this class.

but: as stefan wrote, <tr flexy:foreach="object.getMethod(),m"> works with methods. Is this a bug which will be fixed soon or will this stay a feature so we can use this...???