|
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 |
BUONJG Smarty n00b
Joined: 25 Feb 2011 Posts: 1
|
Posted: Fri Feb 25, 2011 6:08 pm Post subject: How to use smarty function in an include |
|
|
Hello,
I have a question about how to use a smarty function in an include.
I have the following:
{include file='std_header.email.tpl' title="$title"}
It works fine, the variable $title is passed to the called template.
I have also a smarty function I use like that :
{gconfig module='TDL_ETATS' value=$etat}
It works really fine.
But now, I would like to mix to two, but I don't know how...
I tried :
- {include file='std_header.email.tpl' title="{gconfig module='TDL_ETATS' value=$etat}"}
and :
- {include file='std_header.email.tpl' title="gconfig module='TDL_ETATS' value=$etat"}
It doesn't work...
Any body can help me?
Regards,
Jean-Guy BUON |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Feb 26, 2011 11:05 am Post subject: |
|
|
In Smarty3
Code: | {include file='std_header.email.tpl' title="{gconfig module='TDL_ETATS' value=$etat}"} | should work.
For Smarty2 use
Code: | {capture assign='title'}{gconfig module='TDL_ETATS' value=$etat}{/capture}
{include file='std_header.email.tpl' title=$title}
|
|
|
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
|