Hi Thomas,

> 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.

The issue we are discussing is different. If I understand correctly, you're 
discussing how to combine a layout template with a content template. So that 
the content is included into the layout template. The problem I got is pure 
in the content template. Many includes and many more variables.

> 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.

You should either do:

$t = new ezcTemplate();
$t->send->a = 1;
$content = $t->process("content");

$t->send = new ezcTemplateVariableCollection();
$t->send->content = $content;
$t->process("layout");

Or do:

$tc = new ezcTemplate();
$tl = new ezcTemplate();

$tc->send->a = 1;
$tl->send->content = $tc->process("content");
$tl->process("layout");


I think it is the correct behavior to keep the send variables when process() 
is called more than once.

Cheers, Raymond.
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to