Q: how to use display() for dynamic embedded tables
| From: | Joe Rice | Date: | Wed, 07 Nov 2001 04:48:05 +0000 |
| Subject: | Q: how to use display() for dynamic embedded tables | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1834@lists.php.net to get a copy of this message | ||
Hello,
I'm relatively new to Smarty and have one problem
i can't figure out. I currently have home.php and home.tpl
working as expected and I'm using php's sessions to maintain state.
In home.tpl i have a embedded table that holds a very straight forward
voting/polling feature. I would like to be able to abstract that
from home.php and home.tpl to poll.php and poll.tpl respectively.
As you can imagine doing this wasn't any big feat. Independently
going to poll.php will display just my poll table. With
the use of require/include i can get the poll back into
home.php. The problem is how do i get the newly abstracted
poll.tpl to embed itself back into home.tpl ?
I'm trying to do this in attempt to allow the space in the
layout where the poll normally sits to be easily changed
to something other then the poll feature.
I guess i'm thinking kind of like a generic API call in
home.tpl that will take whatever it gets back and display it.
I've tried {fetch file='http://URL/poll.php'}, this worked but
didn't remember or maintain any of the session values. using
include/require in home.php will maintain the sessions but
in my approach won't embed the poll table in home.tpl.
Any help would greatly be appreciated.
Thanks,
joe