我想包括一個名爲includes.php
的PHP文件,它不包含在正常的Views文件夾中。該文件包含指向要用這個特定主題加載的JS文件的鏈接。 includes.php
駐留在scripts
文件夾中:無法加載請求的文件 - CodeIgniter
| 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
什麼其他問題可能會有除了代碼點火器沒有找到與文件路徑的文件?我錯過了明顯的東西嗎?
你確定什麼permissons夠了嗎? ps chmod 777 -R/var/www/ – NiLL
是的,它們設置爲744. –
可以試試使用base_url()。'assets/themes'。$ theme。'/ scripts/includes.php'? – NiLL