跳转到主要内容
learningxm 提交于 1 December 2012

drupal_access_denied()替换为 AccessDeniedHttpException()

drupal_not_fount()替换为 NotFoundHttpException();

drupal7没有权限

drupal_access_denied(); drupal_exit();

drupal8替换为

throw new AccessDeniedHttpException();

drupal7没有找到

drupal_not_found(); drupal_exit();

drupal8替换为

throw new NotFoundHttpException();

别忘了调用类库:

use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;