1
我想呼应BASE_URL()像这样使用BASE_URL():不能在笨
editor_header.php
<link href="<?php echo base_url(); ?>/css/bootstrap.css" rel="stylesheet" media="screen">
为editor_header.php控制器看起来像这样:
<?php
class Pages extends CI_Controller {
public function view($page = 'home')
{
if (! file_exists('application/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}
$data['title'] = ucfirst($page); // Capitalize the first letter
$this->load->view('head&foot/editor_header', $data);
}
}
?>
我已经启用url_helper在autoload.php像这样
$autoload['helper'] = array('url');
但我仍然得到错误:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /Applications/XAMPP/xamppfiles/htdocs/editor/application/controllers/pages.php on line 5
pages.php高于控制器。
我的问题
请任何人都可以提出建议,为什么editor_header.php不能使用BASE_URL?提前致谢。
什么是整个错误消息? – Repox 2013-03-10 17:00:54
我已更新我的回答 – 2013-03-10 17:03:35
您运行的是哪个版本的PHP? – Repox 2013-03-10 17:05:18