我将变量加载到Codeigniter中后,希望从一个视图文件向另一个视图提供变量。假设我在视图文件名example.php中有一个代码段]
$test = 'test'
并且我像这样加载此视图文件test.php
$ this-> load-> view('example.php')在test.php之后,我想在test.php视图文件中获取变量$ test的值
仅通过
$data = ['test' => $test];
喜欢
$this->load->view('example.php', $data);