[英]PHP can't find class 'GhostMailer'
因此,我試圖調用郵件程序類的某些功能。在phpStorm中,當我鍵入GhostMailer::setSender();
當我單擊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();
我該如何解決?
在我看來,該類(文件)並未真正加載,因此該類在運行時不存在。
在composer.json
的classmap
數組中添加"app/classes"
,然后運行composer dump-autoload
,您應該一切順利
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.