|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
scdgro Smarty Regular
Joined: 24 May 2003 Posts: 39 Location: Netherlands
|
Posted: Sat May 24, 2003 8:41 pm Post subject: parsing a file to a variable |
|
|
Next question :
I wondered if this is possible
Code: | $test = new Smarty
$test-> assign (foo,bar)
$test-> assign (foo1,bar1) |
and then instead of the normal
Code: | $test->display('template') |
parse the content of $test->display('template') into a variable.
In C++ terms
Code: | $evaluated_code_from_test = $test->display('template'); |
As if the content were stored in $evaluated_code instead of displayed on the screen.
And then, later in de code, do something like this :
$another_smarty->assign('evaluated_code', $evaluated_code_from_test);
$another_smarty->display('template below');
<template below>
Code: | {$evaluated_code} <--- output from $test
rest of the template_below
|
|
|
Back to top |
|
aloner Smarty Rookie
Joined: 24 Apr 2003 Posts: 24
|
Posted: Sat May 24, 2003 8:48 pm Post subject: |
|
|
Maybe you need
$var = $smarty->fetch('template.html') _________________ Your ad here. |
|
Back to top |
|
scdgro Smarty Regular
Joined: 24 May 2003 Posts: 39 Location: Netherlands
|
Posted: Sat May 24, 2003 9:19 pm Post subject: |
|
|
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|