1
如何在同一個控制器中的兩個函數之間傳遞變量?使用codeigniter在同一個控制器中的函數之間傳遞變量
我需要使用$ this-> session-> set_flashdata這是正確的路嗎?
function load() {
$this->userhash = $this->uri->segment(3);
}
function save() {
$query_customer = $this->Customers->get_customer($this->userhash);
}
對不起,如果這是一個基本的東西,但我還在學習。
我需要編輯我的問題
在伊萬的鏈接,我也用Google搜索了
有哪些是這樣
function index() {
$this->msg = 'data';
$this->testme();
}
function testme() {
echo $this->msg;
}
及其作品的代碼,但我不能撥打$ this-> testme()直接在索引(),所以我無法加載s AVE()在負載()
我也是谷歌這一點,但在這裏,他是調用$這個 - >指數();再次在功能上,我不能那樣做。我只是嘗試使用$ this-> session-> set_flashdata及其工作方式,但我不確定是否是正確的方式。 – Nemanja 2011-05-15 21:55:01
你可以使用數據庫或$ _GET :) – Ivan 2011-05-15 22:52:11
不是真的我使用$ this-> uri-> segment(3)來獲取var – Nemanja 2011-05-15 23:21:26