[Zope3-Users] Re: How can I register a simple content provider (i.e.not viewlet)

Philipp von Weitershausen philipp at weitershausen.de
Fri Nov 30 12:04:58 EST 2007


Yuan HOng wrote:
> On Nov 29, 2007 1:07 PM, Roger Ineichen <dev at projekt01.ch> wrote:
> 
>> You can use the adapter directive for this.
>>
>> class IHeaderProvider(zope.contentprovider.interfaces.IContentProvider):
>>     """Header provider."""
>>
>> class HeaderProvider(object):
>>     """Header content provider."""
>>
>>     zope.interface.implements(IHeaderProvider)
>>     zope.component.adapts(zope.interface.Interface, IMySkinBrowserLayer,
>> zope.interface.Interface)
>>
>> <zope:adapter
>>     name="IHeaderProvider"
>>     factory=".header.HeaderProvider"
>>     />
>>
> 
> Thanks. Now I understand. A simple content provider is nothing but a
> normal adapter which adapts to IContentProvider.

Yes, it's a multiadapter that adapts an object, the request and a view 
to IContentProvider.



More information about the Zope3-users mailing list