:::
9-10 執行完回到原本頁面
- 在刪除或編輯報名後,預設會回到列表,而非原本所在的觀看單一活動頁面(
index.php?op=show&action_id=活動編號),這樣有點不順手,因此,可以修改儲存、更新、刪除後,轉向(header("location:xxx"))的位置case "edit": $ApplyModel->edit($clean['apply_id']); break; ...略... case "update": $ApplyModel->update($clean['apply_id']); header("location:{$from}"); exit; case "store": $ApplyModel->store(); header("location:{$self}"); exit; case "destroy": $ApplyModel->destroy($clean['apply_id']); header("location:{$from}"); exit;原本是轉向到
$self,也就是$_SERVER['PHP_SELF'](目前所在的這頁,也就是index.php)
改用$form就會改用$_SERVER['HTTP_REFERER'],也就是送出前的位置,會包含參數,亦即index.php?op=show&action_id=1
9-9 根據群組來拿掉或取代資料