[Zope3-Users] z3c.form - How to register IFormLayer?

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Jun 19 18:24:43 EDT 2007


On Friday 15 June 2007 12:10, Hermann Himmelbauer wrote:
> So, at first, what's the idea with this IFormLayer? Why does any request to
> provide this interface? How can I tell Zope that all requests implement
> this interface?

The problem with the older form-related frameworks is that their registrations 
are made on the default browser layer, making it (1) very hard to selectively 
add registrations to your own layer/skin, and (2) polluting the default 
browser layer.

z3c.form fixes this problem by creating a new layer dedicated to the form 
registrations. All you need to do is to inherit this layer in your custom 
skin to get the form registrations to work. Philipp provided the sample code 
already.

Yes, this does mean that z3c.form cannot be used within any of the default 
skins, such as Rotterdam, but that's exactely the point. Of course, you can 
just simply make all the registrations in the Rotterdam layer/skin and 
z3c.form will be available there.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list