> Solution 9: Template contextes
> ------------------------------
>
> You define some "context", or collection, I don't know a better word
> yet, which aggregates several variables.
>
> $t = new ezcTemplate();
> $t->collection->foo = new ezcTemplateVariableCollection();
> $t->collection->foo->a = 1;
> $t->collection->foo->b = 2;
> $t->process("p");
>
> Template p and q are:
>
> Template p:
> {use $foo}
> {include "q"}
>
> Template q:
> {use $foo}
> {$foo->a}
> {$foo->b}
>
> The main difference is here, that you don't need to pass this
> collection, but just import it in every template you want.

Looks like the group 1 solutions, but then the variables are not assigned to 
$this->send but to something else like: $this->collection.

> - This can be documented, even it is not easily user visible.
>
> - You could use another block for this, for example {import} and not
>   {use} to make it even more obvious.

With import it start to look like the solutions from group 2. 

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

Reply via email to