1
我想表單提交到當前URI,就像這樣:如何在python的mako模板系統中訪問當前的URI?
<form action="${CURRENT_URI}" method="post">
<input type="text" name="email" />
</form>
從鯖模板中
。但我不確定哪個變量保存了當前的uri信息。
謝謝。
我想表單提交到當前URI,就像這樣:如何在python的mako模板系統中訪問當前的URI?
<form action="${CURRENT_URI}" method="post">
<input type="text" name="email" />
</form>
從鯖模板中
。但我不確定哪個變量保存了當前的uri信息。
謝謝。
其實你不需要它。
<form action="" method="post">
<input type="text" name="email" />
</form>
如果您將動作保留爲空,它將被髮送到當前的URL。
但是,如果您因爲某些其他原因需要當前網址,則可以通過致電pylons.url.current()