在Silverstripe <3中,您可以在表单操作中像这样做smth
Director::redirect(Director::baseURL(). $this->URLSegment . "/?success=1");
然后在模板中,如果表单已提交,您可以检查<% if Success %>。
在>3.1版本中,您将获得
Fatal error: Call to undefined method Director::redirect()
不知何故,一个人应该使用SS_HTTPRequest,但我不知道如何使用这个人。
我想在表单提交后显示一条简单的成功消息。
发布于 2013-07-04 00:41:58
假设您正在处理要重定向的Controller
中的表单提交,您可以使用
$this->redirect( Director::baseURL() . $this->URLSegment . "/?success=1" );
https://stackoverflow.com/questions/17450399
复制相似问题