Skip to content

Commit cdb45e8

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent 9f88619 commit cdb45e8

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

doc/customizing.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising 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

21332133
where "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

21362153
Examples
21372154
========

0 commit comments

Comments
 (0)