[李景山php]每天laravel-20160930|ValidationException.php

来源:互联网 发布:ketchup mac 编辑:程序博客网 时间:2024/05/16 18:00
<?phpnamespace Illuminate\Validation;use Exception;// more namespaceclass ValidationException extends Exception{    /**     * The validator instance.     *     * @var \Illuminate\Validation\Validator     */    public $validator;//The validator instance.    /**     * The recommended response to send to the client.     *     * @var \Illuminate\Http\Response|null     */    public $response;// The recommended response to send to the client    /**     * Create a new exception instance.     *     * @param  \Illuminate\Validation\Validator  $validator     * @param  \Illuminate\Http\Response  $response     * @return void     */    public function __construct($validator, $response = null)    {        parent::__construct('The given data failed to pass validation.');        $this->response = $response;        $this->validator = $validator;    }// parent::    // use parent __construct    /**     * Get the underlying response instance.     *     * @return \Symfony\Component\HttpFoundation\Response     */    public function getResponse()    {        return $this->response;    }// i like or hate get}
0 0
原创粉丝点击