arbitrary delimiters in templates

90 views
Skip to first unread message

mdipierro

unread,
Sep 8, 2010, 10:45:19 AM9/8/10
to web2py-users
I just implemented arbitrary delimiters in web2py trunk. Now you can
do in a controller:

def render(filename,**variables):
context = globals()
context.update(variables)
from gluon.template import render
return
render(filename=os.path.join(request.folder,'views',filename),
path=os.path.join(request.folder,'views'),
context=context,delimiters=('{%','%}'))

def index():
return render('default/index.html',message='hello world')

and in default/index.html:

{%=message%}

This is very new (5 mins ago) so give it a try and let me know if it
works for you.
Not sure it is a good idea. Not sure it should stay. Not sure it works
100%.
Anyway, share your thoughts.

Massimo

Michele Comitini

unread,
Sep 8, 2010, 11:26:41 AM9/8/10
to web...@googlegroups.com
great!

2010/9/8 mdipierro <mdip...@cs.depaul.edu>:

Reply all
Reply to author
Forward
0 new messages