2016-02-04 49 views
0

這裏是我的問題我在我的本地設置Codeigniter 3,現在使用第三方(MX的東西),我已經調整了文件路徑,我想改變正在獲取控制器的文件擴展名。如何使用codeigniter 3更改視圖中的擴展名?

$this->load->view('welcome_message'); 

我的觀點從更改文件:

welcome_message.php 

這個

welcome_message.html 

現在我得到這個錯誤

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

,但我想使用.html擴展監守,我將使用只包含HTML/JS/CSS(模板文件夾)的文件夾路徑文件只(我會分開PHP文件到模板文件夾) 。這怎麼可能發生?

任何幫助非常感謝,謝謝你們!

+0

更改$ this-> load-> view('welcome_message');包含(「application/views/welcome_message.html」); –

回答

4

你不需要改變擴展名爲html,你可以在一個php文件中使用html,只是不要打開php標籤。

編輯:

如果你真的有改變分機,只是做:

$this->load->view('welcome_message.html'); 
+0

不客氣,很高興我幫你@BrylleLagunda – Gwendal

+0

哎呀好吧! :) – Bry

+0

您的請求沒有通過CI索引,你的URL和你的.htaccess是什麼? – Gwendal

相關問題