2016-12-21 10 views

答えて

1

動作しているようですしない

if ($model == null) { 
    // (I want the front layout only for this exception,so this 'throw' seems not to working as I want,it has the 'site' layout of site/error default error action)throw new NotFoundHttpException('The patient does not exist.'); 
      $exception = new \yii\web\NotFoundHttpException("The patient does not exist"); 
      $statusCode = $exception->statusCode; 
      $name = $exception->getName(); 
      $message = $exception->getMessage(); 
      return $this->render('error', [ 
         'exception' => $exception, 
         'statusCode' => $statusCode, 
         'name' => $name, 
         'message' => $message 
      ]); 
関連する問題