How can I pass multiple variables into a template in Webpy?

713 views Asked by At

I would like to pass three different variables into an html template I have using Web.py.

Here's what I have:

class mainScreen:
    def __init__(self):
        self.render=web.template.render('templates/')
    def GET(self):
        return self.render.firstScreen(variable1, variable2, variable3)
    def POST(self):
        pass

And in my html template:

$def with (variable1)
$def with (variable2)
$def with (variable3)
<!DOCTYPE html>
<html>
<head>
    <title>variable1</title>
</head>
    <body>
        $variable2
        <h1>$variable3</h1>
    </body>
</html>

However, in my html template I'm getting a syntax error at the top where I'm defining with each of the three variables. How can I properly pass in the three variables?

1

There are 1 answers

0
wherby On BEST ANSWER

Using like

$def with(product, release, p0,p1,p2,p3, viewby, fromTime, toTime, errormsg, imgurl)