|
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 |
coptang Smarty n00b
Joined: 08 Apr 2007 Posts: 4
|
Posted: Sun Apr 08, 2007 1:24 pm Post subject: header and footer question |
|
|
Hi, I'm new to smarty but I've had a read of the docs and can't find an answer to my question:
My site header is very personalised and would require about 5 or 6 differnt var's passed to it. Do I have to do the following with each page template or is there an easier way?
{include file="header.tpl" var1=$var1 var2=$var2 var3=$var3 var4=$var4 var5=$var5}
page content, page content, page content, page content, page content, page content, page content, page content.
{include file="footer.tpl"} |
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Sun Apr 08, 2007 6:03 pm Post subject: |
|
|
I prefer to assign page specific parameters before including the files:
{assign var="title" value="Page Title"}
{include file="header.tpl"} |
|
Back to top |
|
coptang Smarty n00b
Joined: 08 Apr 2007 Posts: 4
|
Posted: Mon Apr 09, 2007 7:13 pm Post subject: |
|
|
been playing a bit more and I think I'm going to use 3 smarty objects/templates: header, content and footer then just render them 1 after the other
unless that's horribly inefficient? |
|
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
|