我想问一下如何从其他函数中但仍在同一控制器中的变量获取数据。...
这是函数,将在其中发送名为$ whs的变量
function deliver($whs_id)
{
$whs = $whs_id; // here is variable to pass
$this->cart->destroy();
$this->template->set_title('Package');
$this->breadcrumbs->push('Package', '/Package');
$this->breadcrumbs->push('Create Package', '/pacakge/index');
$data['item'] = $this->MY_Model->join2_where('box_stock','product_code','box_product','product_code','whs_id',$whs_id)->result();
$this->template->load('templates/Template', $this->folder.'/item', $data);
}
function save()
{
$whs2 =$whs; // i will get data in here
// judul halaman
$this->template->set_title('Package');
// Breadcrumbs
$this->breadcrumbs->push('Package', 'package');
$this->breadcrumbs->push('Save', '/package/save');
// JS Init
$js_init = "";
}
如何获取同一控制器中另一个函数中的数据?