|
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 |
orthanc Smarty n00b
Joined: 19 Aug 2004 Posts: 1
|
Posted: Thu Aug 19, 2004 2:21 pm Post subject: fetching templates via var |
|
|
Hi All,
I'm new to using smarty and so i may have missed something in the manual but I'm sure you lot will be able to point me in the right direction.
Simply, I want to know if its possible to pass the template to the fetch (or equivalent) method as a variable (below is only an example)
Code: |
$smarty new Smarty;
$my_template = get_my_template_data();
$output = $smarty->fetch($my_template);
|
Am i right in thinking that the only way i'm going to be able to do this is by creating Custom resources
Many thanks |
|
Back to top |
|
dthought Smarty Regular
Joined: 21 Apr 2003 Posts: 55 Location: Melbourne, Australia
|
Posted: Wed Aug 25, 2004 7:15 am Post subject: |
|
|
Not quite sure what you're doing there, but an easy example of fetch:
$mytemplate = $smarty->fetch('mytemplate.tpl');
$smarty->assign('mytemplate', $mytemplate);
$smarty->display('finaltemplate.tpl');
And inside finaltemplate.tpl:
{$mytemplate}
Pretty easy once you get the hang of it |
|
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
|