当用户提交表单时,我需要在同一页上为他输出消息。
当我提交一个表单时,页面刷新,处理程序触发(php函数),一些POST数据插入到数据库中,我设置了$this['success'] = 1,然后与Twig检查:
{% if success %}
here is many tags with information and a message
{% else %}
here is a form
{% endif %}
但是,如果我按下F5,表单将重新提交,插入查询将再次执行。
用AJAX来做这个请求不是一个真正的选择。