0
我的問題看起來很愚蠢,但我需要聯繫並做出決定。我想將參數傳遞給url,而不需要在url中看到參數。這是爲了保護我的服務器。由於URL看起來像這樣Kohana 3.3獲取網址參數
控制器/編輯/ 123
和 '123' 是在數據庫中的用戶ID。 我可以簡單的做到這一點
public function action_edit($id) {
get_db_info($id);
}
是否有可能隱藏參數,同時從視圖重定向到這個網址?即在視圖文件
// Do something to set the ID
<?php Kohana_Request::post("user_id", $id); ?>
<a href="<?=URL::base()?>controller/edit">Click</a>
,並得到這樣
public function action_edit() {
$id = $this->request->post("user_id");
get_db_info($id);
}
但我不能訪問KOhana_Request實例,並得到這個錯誤
*非靜態方法的問題Kohana_Request的ID :: post()不應該被稱爲靜態*
有人可以提供一個安全的方法呢?