0
我剛剛看了一個介紹在PHP中的異常,並希望在我TYPO3擴展使用它們,但使用這個時,我得到一個錯誤......TYPO3 6.2如何使用try-catch塊
try{
if(arrayEmpty){
throw new Exception('Error Msg...');
}
} catch (Exception $e){
$this->addFlashMessage($e->getMessage());
}
Fatal error: Class '...\Exception' not found in /.../controller.php on line ...
我必須在我的PHP文件的頂部放置某種名稱空間,或者我應該如何完成這項工作?
ahhh,我認爲這將解決我的問題確實thx!我會稍後再嘗試,並在您的答案被接受時將其標記爲:) –