我有一种感觉,有一个非常明显的解决方案,但我只是没有看到它。我正在用codeigniter建立一个网站。
在我的视图目录中,我有两个文件夹:template
&auth
.
我试图将标题从template
目录包含到auth
目录中的php文件。
我把它放在顶部,和include '../template/header.php;'
但是我得到错误:
消息:include(../template/header.php): failed to open stream: No such file or directory
文件名:身份验证/login。
要在CodeIgniter
中包含任何文件,您应该这样做:
$this->load->view('template/header');
您可以在这里阅读更多关于在CodeIgniter
中包含文件的信息:
如何在codeigniter模型中包含文件?