Templates and partial rendering?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm trying to find a graceful solution for a problem I ran into while trying to set up a templating system.

The problem is as such: Every traditional templating solution implies that the template is assembled in a string with all the required data before being sent to the browser. This for me is a Bad Thing (tm), because some of my data is pulled off an XML webservice, which sometimes isn't too quick about answering, and having the user stare at a blank page during that time is just not viable. (Calls to the webservice are obviously cached to as much of an extent as possible, so that's not the problem).

So, what I need is a way to be able to render chunks of the page as they come in, as opposed to all at the same time, but still retain the ability to reuse the same HTML in multiple pages. As far as I've seen so far, the only way I can do this is to make functions with static HTML and calling them from each page as I need them. But this isn't very mantainable, I'd much rather use a template system that I can easily alter, much like in a traditional template system.

As far as I know, and please correct me if I'm wrong, none of the OOB template systems out there support this kind of behavior. Does anyone have any ideas about how one might implement it (in PHP4, preferably)?

My best thought right now involves passing lists of function callbacks into a template class, and having it run them as it needs them, but this seems to be a somewhat messy approach. Any insight is appreciated.

Best,

- Alex "Sunstorm"

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux