1.

How To I Specify An Alternate Template To Use In My Controller Method?

Answer»

Put tg_template set to the NAME of the template you want to USE into the dictionary you return from your CONTROLLER method

e.g.:

@EXPOSE('.templates.index')
def index(self, **KW):
d = dict(message='Hello World!')
if some_condition:
d['tg_template'] = '.templates.other'
return d

Put tg_template set to the name of the template you want to use into the dictionary you return from your controller method

e.g.:

@expose('.templates.index')
def index(self, **kw):
d = dict(message='Hello World!')
if some_condition:
d['tg_template'] = '.templates.other'
return d



Discussion

No Comment Found