无法加载请求的文件- CodeIgniter


Unable to load the requested file - CodeIgniter

我试图包含一个名为includes.php的PHP文件,该文件不包含在正常视图文件夹中。该文件包含要用这个特定主题加载的JS文件的链接。includes.phpscripts文件夹中:

| assets |
         | themes
                  | theme_name
                               | css
                               | img
                               | scripts
| application
| system

在我的控制器中,我使用$this->load->helper('url'),它总是工作得很好,在视图中,我试图调用以下内容:

$includes_url = asset_url() . 'themes/' . $theme . '/scripts/includes.php';
$this->load->file($includes_url);

URL似乎是正确的,因为当我回显$includes_url时,路径是好的。

尽管如此,我还是得到了错误:

An Error Was Encountered
Unable to load the requested file: includes.php

除了代码点火器没有找到具有该文件路径的文件之外,还有什么其他问题?我错过了什么明显的东西吗?

我认为你正在使用。htaccess文件与编码器,这会导致你在获得你想要包含的PHP文件的确切路径的问题。用包含include文件的PARENT文件夹的名称重命名下面代码中的单词库,然后用现有的。htaccess文件更新它。

<>之前RewriteEngine上^(index'.php|library|user_guide|robots'.txt)rewriterrule ^(.*)$ index.php/$1