我想保存在codeigniters'會話輔助的數組,但我不斷收到如何在codeigniter中將數組保存到會話中?
我想保存在一個新的會話變量數組的數組,這樣我可以在另一個控制器查看會話,如果我需要它或另一種觀點。
我的會話在我的配置文件中自動加載。
這段代碼在我的視圖文件中。 $ arr = array();
foreach($value->result as $val){}
if($val->somethinghappenedtrue){
$arr[] = array('data' => $thethingthathappened);
}
}
// since my session is autoloaded I don't need to initialize
//session if I'm not wrong $this->load->session etc...
$this->session->new_session_name($arr);
Fatal error: Call to undefined method CI_Session::new_session_name()
你加載Session庫? $ this-> load-> library('session'); –
是這個CI 3.x - 你可以嘗試文檔,http://www.codeigniter.com/user_guide/libraries/sessions.html#adding-session-data在任何情況下,你的錯誤是從調用一個方法,dosn' t存在於CI_Session中。由於我使用其他集成(用於成員身份登錄)與我的CI站點,因此我不使用CI進行會話.... – ArtisticPhoenix