SiteController.php 555 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace oauth2\controllers;
  3. use Yii;
  4. use yii\web\Controller;
  5. use yii\web\NotFoundHttpException;
  6. /**
  7. * Class SiteController
  8. * @package oauth2\controllers
  9. * @author jianyan74 <751393839@qq.com>
  10. */
  11. class SiteController extends Controller
  12. {
  13. /**
  14. * @return string
  15. */
  16. public function actionError()
  17. {
  18. if (($exception = Yii::$app->getErrorHandler()->exception) === null) {
  19. $exception = new NotFoundHttpException(Yii::t('yii', 'Page not found.'));
  20. }
  21. return $exception->getMessage();
  22. }
  23. }
粤ICP备19079148号