2016-03-15 62 views
-1

當我在做服務器端驗證時,我正在傾銷$errors陣列。你能解釋這個數組格式嗎? #標記是什麼意思?什麼是#袋,#消息?

ViewErrorBag {#135 ▼ 
    #bags: array:1 [▼ 
    "default" => MessageBag {#136 ▼ 
     #messages: array:5 [▼ 
     "fullname" => array:1 [▼ 
      0 => "The fullname field is required." 
     ] 
     "email" => array:1 [▼ 
      0 => "The email field is required." 
     ] 
     "username" => array:1 [▼ 
      0 => "The username field is required." 
     ] 
     "password" => array:1 [▼ 
      0 => "The password field is required." 
     ] 
     "gender" => array:1 [▼ 
      0 => "The gender field is required." 
     ] 
     ] 
     #format: ":message" 
    } 
    ] 
} 
+0

這只是一個存儲消息組的類。 https://laravel.com/api/5.4/Illuminate/Contracts/Support/MessageBag.html – ceejayoz

回答

0

ViewErrorBag是一個MessageBags數組,這就是全部。 #袋只是參考陣列