Yet Another Framework Yaf_Application::getLastErrorMsg

(Yaf >=2.1.2)

Yaf_Application::getLastErrorMsg — 마지막으로 발생한 오류 메시지 가져오기


설명

public Yaf_Application::getLastErrorMsg(): string


매개변수

이 함수에는 매개변수가 없습니다.


반환 값


Examples

예제 #1 Yaf_Application::getLastErrorMsg() 예제

                  
<?php
function error_handler($errno, $errstr, $errfile, $errline) {
   var_dump(Yaf_Application::app()->getLastErrorMsg());
}

$config = array(
 "application" => array(
   "directory" => "/tmp/notexists",
     "dispatcher" => array(
       "throwException" => 0, //trigger error instead of throw exception when error occure
      ),
  ),
);

$app = new Yaf_Application($config);
$app->getDispatcher()->setErrorHandler("error_handler", E_RECOVERABLE_ERROR);
$app->run();
?>
                  
                

위의 예는 다음과 유사한 결과를 출력합니다.

string(69) "Could not find controller script /tmp/notexists/controllers/Index.php"