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

Newby question: architecture

 
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
pdxchris
Smarty n00b


Joined: 09 Jul 2003
Posts: 3
Location: Portland, Oregon

PostPosted: Wed Jul 09, 2003 1:28 am    Post subject: Newby question: architecture Reply with quote

My question is on how to structure templates. Specifically, I am trying to build "widgets" or "components". Here's a concrete example, I would like to build some fancy tables, with who knows what kind of html. In php I could write:

Code:

function build_fancy_table ($contents) {
   ... do something ...
}

build_fancy_table (array("A", "B", "C"));
build_fancy_table (array("D", "E", "F"));


How do I do the same thing for Smarty? The closest I see is Smarty's {include} directive. But this requires me to create a template file for each function - yes? I have to say, this seems unwieldy.

So what's the solution? One function per template file? Forget about using functions? Something else?

TIA
Back to top
View user's profile Send private message
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