2015-04-14 34 views
0

,所以我試圖調用郵件類的一些功能.. 在phpStorm當我鍵入GhostMailer::setSender();PHP找不到類「GhostMailer」

我可以導航到該文件當我點擊我的滾動按鈕在GhostMailer::文本到GhostMailer是成,但每當我運行程序它說沒有找到類GhostMailer ..

代碼調用

GhostMailer::setSender(Input::get('emailfrom')); 
GhostMailer::addRecipient(Input::get('emailto')); 
GhostMailer::setSubject(Input::get('subject')); 
GhostMailer::setHTML(true); 
GhostMailer::setMessage(Input::get('email')); 
GhostMailer::setReturnAddress(Input::get('emailfrom')); 
GhostMailer::getHeaders(); 
GhostMailer::send(); 

如何解決這個問題?

+0

這聽起來好像類(文件)不實際加載,因此類不存在時運行時 – lukasgeiter

+0

感謝您的回覆,但我如何加載文件,然後因爲我從來沒有聽說過這個@lukasgeiter –

+0

這取決於...是你自己的類還是來自第三方包?該文件還位於何處? – lukasgeiter

回答

1

這對我來說聽起來像類(文件)沒有實際加載,因此該類在運行時不存在。

添加"app/classes",到classmap陣列中composer.json,然後運行composer dump-autoload,你應該是好去