cvs: pear /HTML_Template_Flexy/Flexy/Compiler/Flexy Flexy.php
| From: | Alan Knowles | Date: | Fri, 21 Jan 2005 01:47:38 +0000 |
| Subject: | cvs: pear /HTML_Template_Flexy/Flexy/Compiler/Flexy Flexy.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-28714@lists.php.net to get a copy of this message | ||
alan_k Thu Jan 20 20:47:38 2005 EDT
Modified files:
/pear/HTML_Template_Flexy/Flexy/Compiler/Flexy Flexy.php
Log:
another go at making scope in included templates work
http://cvs.php.net/diff.php/pear/HTML_Template_Flexy/Flexy/Compiler/Flexy/Flexy.php?r1=1.4&r2=1.5&ty=u
Index: pear/HTML_Template_Flexy/Flexy/Compiler/Flexy/Flexy.php
diff -u pear/HTML_Template_Flexy/Flexy/Compiler/Flexy/Flexy.php:1.4
pear/HTML_Template_Flexy/Flexy/Compiler/Flexy/Flexy.php:1.5
--- pear/HTML_Template_Flexy/Flexy/Compiler/Flexy/Flexy.php:1.4 Thu Jan 20 06:26:48 2005
+++ pear/HTML_Template_Flexy/Flexy/Compiler/Flexy/Flexy.php Thu Jan 20 20:47:37 2005
@@ -16,7 +16,7 @@
// | Authors: Alan Knowles <alan@akkbhome.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Flexy.php,v 1.4 2005/01/20 11:26:48 alan_k Exp $
+// $Id: Flexy.php,v 1.5 2005/01/21 01:47:37 alan_k Exp $
//
// Handler code for the <flexy: namespace
//
@@ -31,7 +31,7 @@
*
*
*
-* @version $Id: Flexy.php,v 1.4 2005/01/20 11:26:48 alan_k Exp $
+* @version $Id: Flexy.php,v 1.5 2005/01/21 01:47:37 alan_k Exp $
*/
class HTML_Template_Flexy_Compiler_Flexy_Flexy {
@@ -137,7 +137,11 @@
return $this->compiler->appendPHP( "\n".
"\$x = new HTML_Template_Flexy(\$this->options);\n".
"\$x->compile('{$arg}');\n".
- "include \$x->compiledTemplate;\n"
+ "\$_t = function_exists('clone') ? clone(\$t) : \$t;\n".
+ "foreach(get_defined_vars(); as \$k=>\$v) {\n" .
+ " if (\$k != 't') { \$_t->\$k = \$v; }\n" .
+ "}\n" .
+ "\$x->outputObject(\$_t, \$this->elements);\n"
);
}