Hello, everyone. I'm confused about the problem of passing parameters to a
html template.
For example, my render is this:
> render = web.template.render('template', base = 'layout')
> ......
> class Index:
> def GET(self):
> return render.index()
And my layout.html is this:
> $def with (content)
> <!DOCTYPE html>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head></head>
> <body>
> $:content
> </body>
> </html>
My question is that how to pass a parameter to the base template
layout.html such as this:
> $def with (content, param)
> <!DOCTYPE html>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head></head>
> <body>
> $if param:
> Hello, my parameter!
> $else:
> $:content
> </body>
> </html>
Any suggestion is appreciated. Thanks.
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/groups/opt_out.