[ZPT] ZPT object called with keywords and pick them up

Wade Leftwich wade@lightlink.com
Tue, 19 Jun 2001 12:46:11 -0400


If you call a ZPT from a script, keyword arguments show up in the "options"
namespace.

In your script:

return container.mytemplate(answer=42)

In your template:

The answer is <span tal:replace="options/answer"/>.


-- Wade Leftwich

--------------------------------------------------------------------


> From: "Peter Bengtsson" <mail@peterbe.com>
> To: <zpt@zope.org>
> Date: Tue, 19 Jun 2001 15:04:20 +0200
> Subject: [ZPT] ZPT object called with keywords and pick them up
>
> When calling a DTML * from Python you pass the 'self', REQUEST, and a free
> keyword argument and the DTML* can pick it up.
>
> <for example>
> displayname.__call__(self, parent, REQUEST, RESPONSE, name='Peter')
> </for example>
>
> That's in Python. To do the same in DTML would be:
> <dtml-let name="'Peter'">
>   <dtml-var displayname>
> </dtml-let>
>
> How is it with ZPT?
>