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 #2145

foreach variables lose scope

Details

Request #2145foreach variables lose scope
Submitted2004-08-17 09:16 UTC
Fromluis at awarez dot net
StatusClosed
PackageHTML_Template_Flexy
PHP Version4.3.6
OSFedoraCore1 - 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.