Sorry for making this thread even longer, but I wonder why you've not included
the approach of sending preprocessed sub-templates to the main template:
$t = new ezcTemplate();
$t->send->a = 2;
$t->send->b = 3;
$subTemplateHtml = $t->process( "subtemplate.ezt" );
$t->send->slot = $subTemplateHtml;
echo $t->process( "main.ezt" );
Template:
{use $slot}
<body>
<div id="rightSlot">
{$slot}
I've already discussed this method with Raymond some months ago and he said,
that it may be a bit slower, but I (with my limited experience) consider it a
much cleaner approach then putting any logic inside the template.
As you see, there may still be a problem, since I'm calling $t->process for
different templates on the same ezcTemplate object, which may cause a clash
of the variables sent for the first and those for the second template.
I kindly ask for a suggestion how to solve this without much performance loss
and without using the template component in an unintended way.
Have a nice weekend,
Thomas Koch
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components