File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 22Customising Roundup
33===================
44
5- :Version: $Revision: 1.93.2.7 $
5+ :Version: $Revision: 1.93.2.8 $
66
77.. This document borrows from the ZopeBook section on ZPT. The original is at:
88 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -2132,6 +2132,23 @@ In your HTML form, add a hidden form element like so::
21322132
21332133where "myaction" is the name you registered in the previous step.
21342134
2135+ Actions may return content to the user
2136+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2137+
2138+ Actions generally perform some database manipulation and then pass control
2139+ on to the rendering of a template in the current context (see `Determining
2140+ web context`_ for how that works.) Some actions will want to generate the
2141+ actual content returned to the user. Action methods may return their own
2142+ content string to be displayed to the user, overriding the templating step.
2143+ In this situation, we assume that the content is HTML by default. You may
2144+ override the content type indicated to the user by calling ``setHeader``::
2145+
2146+ self.setHeader('Content-Type', 'text/csv')
2147+
2148+ This example indicates that the value sent back to the user is actually
2149+ comma-separated value content (eg. something to be loaded into a
2150+ spreadsheet or database).
2151+
21352152
21362153Examples
21372154========
You can’t perform that action at this time.
0 commit comments