Home » HTML » HTML_Template_Flexy » Bug #2145
foreach variables lose scope
Details
| Request #2145 | foreach variables lose scope |
|---|---|
| Submitted | 2004-08-17 09:16 UTC |
| From | luis at awarez dot net |
| Status | Closed |
| Package | HTML_Template_Flexy |
| PHP Version | 4.3.6 |
| OS | FedoraCore1 - 2.4.22-1.2179.nptl |
| Roadmaps | (Not assigned) |
Comments
[2004-08-17 09:16 UTC] luis at awarez dot net
Description:
------------
When including a template inside a loop statement (foreach), the variables lose scope, due to the fact that they adopt the format $varname instead of $t->varname.
Because of the way Flexy parses the templates, the included file’s variables are parsed and compiled to PHP, resulting in the usual $t->varname. This means that there is no apparent way for the included file to have access to the variables resulting from the foreach, which are compiled simply as $varname.
Expected result:
----------------
Expect for included template to be able to access foreach's variables.