當創建在Plone一個BrowserView模板之間的區別,我知道我可以選擇配置模板,ZCML像這樣:是什麼在ZCML和ViewPageTemplateFile
<configure
xmlns:browser="http://namespaces.zope.org/browser"
>
<browser:page
…
class=".foo.FooView"
template="foo.pt"
…
/>
</configure>
或可替代代碼:
# foo.py
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.publisher.browser import BrowserPage
class FooView(BrowserPage):
"""
My View
"""
def __call__(self):
return ViewPageTemplateFile('foo.pt')(self)
這兩種方法有什麼不同嗎?他們都似乎產生相同的結果。
子問題:我知道有一個BrowserView
類一個可以導入,但是通常每個人都使用BrowserPage
。如果兩個類別之間存在顯着差異怎麼辦?
請不要在這裏的帖子中使用URL更短的內容,絕對沒有必要也不需要模糊你正在鏈接的內容。 –
嗨,但願svn.zope.org網址在哪裏不被識別爲*,因爲它的URL。感謝編輯 – toutpt
正確的,當用作普通URL(而不是鏈接)時,配對的'*'星號被解釋爲'斜體'的標記。 –