0
的阵列我在笨和里面创建一个控制器的变量,创建了两个阵列:传递变量,以查看是它阵列
$header_data['base_url'] = base_url();
$templates['header'] = "/application/views/templates/header.php";
$templates['auth_page'] = "/application/views/templates/auth_page.php";
$templates['footer'] = "/application/views/templates/footer.php";
现在我创建包含先前阵列的一个独特的阵列:
$page_data['data_header'] = $header_data;
$page_data['templates'] = $templates;
,并把它传递给视图:
$this->load->view('main.php',$page_data);
现在,一旦我们在视图我怎么能叫的VAR因为它在header_data
里面,所以它在$page_data
数组里面吗?
'$ page_data [ 'data_header'] [ 'BASE_URL']'? – Josh 2012-02-12 16:44:23