[PHPTAL] Best way to execute different templates in the same context?

Kornel Lesinski kornel at aardvarkmedia.co.uk
Mon Apr 2 17:15:35 CEST 2007


In application I'm working on pages are created in two phases (and I can't  
change that):
1. main content of the page is prepared and stored as HTML
2. later this content is used in another template that adds rest of the  
HTML

If I just execute them on separate instances of PHPTAL, I can't share  
global variables and macros (filled slots) between the two.

I've tried to hack PHPTAL to allow that by copying $tpl->_context and  
$tpl->_globalContext to new instance, but it doesn't work -  
$tpl->_context->_slots doesn't contain slots filled in previous template.

-- 
regards, Kornel



More information about the PHPTAL mailing list