CodeIgniter Fatal error: Class ‘MY_Controller’ not found in D:xampphtdocsCodeIgniterapplicationcontrollerscontactus.php on line 4

在嘗試寫一個Override Controller 之後
當我嘗試Refresh我的Web Page 時出現了這個錯誤信息
Fatal error: Class 'MY_Controller' not found in D:xampphtdocsCodeIgniterapplicationcontrollerscontactus.php on line 4
Fatal error: Class ‘MY_Controller’ not found in D:xampphtdocsCodeIgniterapplicationcontrollerscontactus.php on line 4

之後發現原來是因為我的Controller嘗試Extends 一個自己更改過的Controller..[MY_Controller]

而我把這個MY_Controller 放錯了在 Library folder 入面…

解決方法:
只要把這個自定的Controller [MY_Controller]放進在 application 資料夾便可
D:xampphtdocsCodeIgniterapplicationcoreMY_Controller.php

Hope you find it useful

Leave a Reply