我用這不加載在我viewregistration.php
文件BASE_URL在笨
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo $base_url; ?><?php echo $css; ?>reg_style.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $base_url; ?><?php echo $css; ?>style.css" />
</head>
<body>
<?php $this->load->view('include/header');?>
<?php $this->load->view('registration_view.php');?>
<?php $this->load->view('include/footer');?>
</body>
</html>
而且我打電話在我conltroller作爲
$data['title']= 'Registration';
$this->load->view("viewregistration.php", $data);
而在我的控制,我使用
parent::__construct();
$this->load->helper('url');
$this->load->helper('form');
$this->load->database();
$this->load->model('user_model');
$this->load->model('systemdata');
$this->data['css'] = $this->systemdata->get_css_filespec();
$this->data['scripts'] = $this->systemdata->get_scripts_filespec();
$this->data['base_url'] = $this->systemdata->get_base_url();
但是css文件沒有加載。這表明像
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: base_url
和
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: css
一些錯誤我做錯了嗎? 我已經使用自動加載網址助手。但結果仍然相同。
請顯示如何加載您的視圖文件。 – 2012-04-17 20:38:12