On Thu, 2007-08-30 at 14:23 +0200, Raymond Bosman wrote:
> Hi,
> 
> I added the solutions mentioned in the previous mails to the proposal. Here 
> are the new solutions and a new evaluation. Please, check if it is correct. 
> 
> The "context" proposal is not included. Frederik or Kore can you give me an 
> example? Please, keep in mind that the word "context" may be confusing 
> because we use that to set the target output to: HTML or text.

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.

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

-- 
Mit freundlichen Grüßen / Med vennlig hilsen
 
Kore Nordmann (GPG: 0xDDC70BBB)
eZ Components Developer
eZ systems Headquaters

tel +49 (0) 231-9742-7750 | fax +49 (0) 231-9742-7751
[EMAIL PROTECTED] | eZ systems | ez.no

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to