Back to index

plone3  3.1.7
Functions
CMFPlone.Extensions.view_source Namespace Reference

Functions

def getObjectSource

Function Documentation

def CMFPlone.Extensions.view_source.getObjectSource (   self,
  template_id = '' 
)

Definition at line 1 of file view_source.py.

00001 def getObjectSource(self, template_id=''):
00002     template = getattr(self, template_id, None)
00003     if template:
00004         self.REQUEST.RESPONSE.setHeader('content-type', 'text/plain')
00005         if hasattr(template, '_text'):
00006             return template._text
00007         if hasattr(template, 'document_src'): #dtml
00008             return template.document_src
00009     return 'source could not be rendered'
00010