|
楼主 |
发表于 2009-6-7 11:53:27
|
显示全部楼层
回版主。
最开始是这样调用头文件:
function __construct(){
parent::Controller();
$this->load->model('admin/adminwebinfo_model');
$this->load->model('admin/adminlog_model');
$this->webinfo = $this->adminwebinfo_model->get();
$this->page_data = array(
'webinfo' => $this->webinfo,
'back_title' => $this->config->item('control_panel'),
'page_title' => '站点综合信息设置'
);
$this->load->view('admin/admin_head',$this->page_data);
$this->load->helper ( array('form','url') );
}
现在是把头文件从控制器中删除。所有的变量放在function index()中完成。而且在视图中,直接使用
<?php echo $this->load->view('admin/admin_head');?>完成。
admin_head.php的代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="<?php echo base_url();?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/table.js"></script>
<link href="<?php echo base_url();?>css/style.css" rel="stylesheet" type="text/css" />
</head>
<body> |
|