On 09-10-2008 at 20:11:22 admi <[EMAIL PROTECTED]> wrote:

I can set it to null if I know it was used in content.html. What if I don't know wchich variables have been used ?

content.html uses $t->content, but I'd like to unset $t->content after executing and not knowing that content.html used only $t->content (it could use $t->title).

You mean that reading of a variable should automatically unset it? i.e.

<div tal:content="title"/>

should remove title variable?

Then it cannot be done exactly like that in PHPTAL.

You could achieve something like this by creating your own object that has __get() method and keeps track of which fields (variables) were read, i.e.

class myobject
        function __get($var) {...}
        function __set($var,$val) {...}

$myobject = new myobject();
$myobject->title = "title";
$phptal->myobject = $myobject;

<div tal:content="myobject/title"/>

regards, Kornel

PHPTAL mailing list

Reply via email to