# HG changeset patch # User Richard Jones # Date 1077683088 0 # Node ID 9e72663e5671095335c103901becb69484efcb0c # Parent 8de56036480a48ba18dee3374c000863f0c9728b *** empty log message *** diff -r 8de56036480a -r 9e72663e5671 doc/customizing.txt --- a/doc/customizing.txt Tue Feb 24 23:49:52 2004 +0000 +++ b/doc/customizing.txt Wed Feb 25 04:24:48 2004 +0000 @@ -2,7 +2,7 @@ Customising Roundup =================== -:Version: $Revision: 1.93.2.7 $ +:Version: $Revision: 1.93.2.8 $ .. This document borrows from the ZopeBook section on ZPT. The original is at: http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx @@ -2132,6 +2132,23 @@ where "myaction" is the name you registered in the previous step. +Actions may return content to the user +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Actions generally perform some database manipulation and then pass control +on to the rendering of a template in the current context (see `Determining +web context`_ for how that works.) Some actions will want to generate the +actual content returned to the user. Action methods may return their own +content string to be displayed to the user, overriding the templating step. +In this situation, we assume that the content is HTML by default. You may +override the content type indicated to the user by calling ``setHeader``:: + + self.setHeader('Content-Type', 'text/csv') + +This example indicates that the value sent back to the user is actually +comma-separated value content (eg. something to be loaded into a +spreadsheet or database). + Examples ========