|
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 |
pdxchris Smarty n00b
Joined: 09 Jul 2003 Posts: 3 Location: Portland, Oregon
|
Posted: Wed Jul 09, 2003 1:28 am Post subject: Newby question: architecture |
|
|
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 |
|
|
|
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
|