Send values to web page - Web Controllers
We need to transmit on rendering page some vars, you need to put that vars in dictionary and place it as second argument:
@http.route(['/shop/checkout'], type='http', auth="public", website=True) def checkout(self, **post): ... values['order'] = order return request.website.render("website_sale.checkout", values)
Active elements
Link-button that calls controller
<form action="/shop/checkout" name="myform" method="post">
<a class="btn btn-primary a-submit">My button</a>
</form>
Here action=”/shop/checkout” sets controller address. Class a-submit usually means do what in ‘action’ of form.
Submit with button
<form action="/my_page" name="myform" method="post">
<button type="submit" class="btn btn-default">My button</button>
</form>
No comments:
Post a Comment