php - 从codeigniter中的另一个函数获取变量
问题描述
我想问一下如何从其他函数中但仍在同一个控制器中的变量中获取数据....
这是函数,其中将发送名为 $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 = "";
}
如何获取同一控制器中另一个函数中的数据?
解决方案
推荐阅读
- assembly - 存储字,加载字和移动之间的区别
- javascript - ASP.NET 部分回发上的 Chrome 自动填充(更新面板)
- postgresql - Postgres 有必要在这个 where 子句中包含两个谓词吗?
- spring - SpringBoot:没有符合条件的 bean 类型
- visual-studio - 在使用 DirectX 11 的系统上编译和运行 VS2017CE 项目时,如何强制使用 DirectX 10 库和 .dll 文件?
- html - CSS - 防止文本换行符破坏弹性对齐
- python - 如何使帖子类别列表在 django 的所有页面中可见
- dns - 具有内部 DNS 名称服务器的 OpenVPN 服务器
- typescript - 如何从节点模块中的@types 保存类型
- c - 为电影标题按字母顺序对c中的链表内容进行排序