- Timestamp:
- Jul 10, 2007, 12:13:12 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_7/include/template.php
r2035 r2056 215 215 function assign_var_from_handle($varname, $handle) 216 216 { 217 if (!$this->loadfile($handle)) 218 { 219 die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle"); 220 } 221 222 trigger_action('loc_before_tpl_assign_var_from_handle', $handle, array(&$this)); 223 // Compile it, with the "no echo statements" option on. 224 $_str = ""; 225 $code = $this->compile($this->uncompiled_code[$handle], true, '_str'); 226 227 // evaluate the variable assignment. 228 eval($code); 229 // assign the value of the generated variable to the given varname. 230 $this->assign_var($varname, $_str); 231 217 trigger_action('loc_before_tpl_assign_var_from_handle', $varname, $handle, array(&$this)); 218 $this->assign_var($varname, $this->parse($handle, true)); 219 return true; 220 } 221 222 /** 223 * Concat the uncompiled code for $handle as the value of $varname in the 224 * root-level. This can be used to effectively include a template in the 225 * middle of another template. 226 * 227 * Note that all desired assignments to the variables in $handle should be 228 * done BEFORE calling this function. 229 */ 230 function concat_var_from_handle($varname, $handle) 231 { 232 trigger_action('loc_before_tpl_concat_var_from_handle', $varname, $handle, array(&$this)); 233 $this->concat_var($varname, $this->parse($handle, true)); 232 234 return true; 233 235 }
Note: See TracChangeset
for help on using the changeset viewer.