如何在删除某些内容时显示消息,并在重定向时在网址末尾添加查询字符串,例如:domain.com/?favor_trashed=294
然后会显示如下消息:
<p>Favor has been successfully deleted</p>
答案 0 :(得分:6)
了解Flash Messenger设计模式,最常见的实现是Zend Framework中的实现 - Zend_Controller_Action_Helper_FlashMessenger
基本理念是
答案 1 :(得分:5)
<?php if (!empty($_GET['favor_trashed'])) : ?>
<p>Favor has been successfully deleted</p>
<?php endif; ?>