Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

parsing a file to a variable

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
scdgro
Smarty Regular


Joined: 24 May 2003
Posts: 39
Location: Netherlands

PostPosted: Sat May 24, 2003 8:41 pm    Post subject: parsing a file to a variable Reply with quote

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
View user's profile Send private message Send e-mail
aloner
Smarty Rookie


Joined: 24 Apr 2003
Posts: 24

PostPosted: Sat May 24, 2003 8:48 pm    Post subject: Reply with quote

Maybe you need
$var = $smarty->fetch('template.html')
_________________
Your ad here.
Back to top
View user's profile Send private message
scdgro
Smarty Regular


Joined: 24 May 2003
Posts: 39
Location: Netherlands

PostPosted: Sat May 24, 2003 9:19 pm    Post subject: Reply with quote

Very Happy
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP