使用codeigniter在同一个控制器中的函数之间传递变量
问题描述:
如何在同一个控制器中的两个函数之间传递变量?使用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