|
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 |
timo Smarty n00b
Joined: 13 Mar 2006 Posts: 3
|
Posted: Mon Mar 13, 2006 6:42 am Post subject: missing FAQ answer |
|
|
How can I assign a variable in an include file, and make it visible to the main (including) template?
I was happy to find my question in the FAQ, but to my disapointment there was no answer. Can any1 help me out here, please?
I have a template that includes several other templates. These included templates contain variables received from php-scripts. The problem is that my nice zend shows me the output, but my browser leaves out the variables. Any1 know how I can make my browser spit it out right?
Thanks in advance,
Timo |
|
Back to top |
|
timo Smarty n00b
Joined: 13 Mar 2006 Posts: 3
|
Posted: Tue Mar 14, 2006 6:06 am Post subject: |
|
|
Solved the problem myself. For any1 with the same problem:
the template can be included normally. Any variables given to this template can be assigned in the php script behind the original template. It is of course cleaner code to make a diffrent script for that and include it in the original script.
My problem turned out to be a wrong pathname
Cheers,
Timo |
|
Back to top |
|
zikoh Smarty n00b
Joined: 28 Mar 2006 Posts: 2
|
Posted: Tue Mar 28, 2006 4:43 pm Post subject: could u give me ur source code? |
|
|
i have a small code.
i have 3 templates file(1.tpl,2.tpl,3.tpl).inside the "1.tpl" have a var "{$var2}" call template '2.tpl', and in template '2.tpl' i have a var "{$var3}" call template '3.tpl'.
Now, how can i do that? i can't assign value for {$var2},{$var3}. i use smarty->fetch('2.tpl'),smarty->fetch('3.tpl') for call template inside is right?
Give me an answer,thanks. |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
|
Back to top |
|
zikoh Smarty n00b
Joined: 28 Mar 2006 Posts: 2
|
Posted: Wed Mar 29, 2006 10:20 am Post subject: |
|
|
plz show me your code,i'm a newbie.so can't understand what you write.Thanks. |
|
Back to top |
|
innoflame Smarty Rookie
Joined: 12 Jul 2011 Posts: 6
|
Posted: Sat Sep 10, 2011 2:32 pm Post subject: need immidiatly |
|
|
i also need to know the solution of this issue :/ |
|
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
|