When playing with multi-level macro nesting (like in recent thread "Macros in macros") I tried to figure out how to redefine template variables. Let's say, I have this structure:
$data => Object (
    "title" => string,
    "name" => string
    "parent" => Object (
        "title" => string,
        "name" => string,
In template I can access first level variables directly (<span tal:content="title" />). Is it possible to "switch context" to "parent" object by some redefining so I could access second level variables not by "parent/title" but also direct "title"? My current (ugly) workaround is $data => Object ("self" => Object(...), "parent" => Object(...)) so I could redefine "self" with "parent" when needed..

What You guys think?


PHPTAL mailing list

Reply via email to