Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8895513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:48:01+00:00 2026-06-14T23:48:01+00:00

It seems the $validator->validate( $class ); of the Symfony2 Validation Service runs through all

  • 0

It seems the $validator->validate( $class ); of the Symfony2 Validation Service runs through all the validation checks before if returns the $error class. This is normally OK but I’m looking for halt_on_failure functionality because once a particular property fails it triggers a PHP error on a proceeding Validation check.

It’s fairly well documented in Symfony-1 that there was a halt_on_error but I’m not sure how this works in Symfony2. I’ve found references to it but no examples.

Here’s a similar question

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:48:03+00:00Added an answer on June 14, 2026 at 11:48 pm

    Found Two solutions for this problem.

    1. Using Groups. Richard Miller
      wrote a nice summary of SF2 Validation with Groups. Essentially,
      what I did was labelled the initial validation steps with
      Step1 and left the rest of the steps alone. You then make the request to the Validator service like this:

      $this->validator->validate($class, array(‘step1’, ‘Default’));

    2. Additional IF Statements. In my situation, I was using an API to validate so I wanted to make sure the inputs were accurate so I didn’t waste an API request. IF statements can be used to cut off the API request and return false.

    What I Choose to do and why

    I choose to go with step 2. While, step 1 was probably better use of the validation technology, I wasn’t wild about the additional group parameters that needed to be added. It was a code maintenance liability. It seems in Symfony2.2, there will be a halt_on_error feature and this solution should be updated at that time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any ideas why this won't validate here: http://validator.w3.org/#validate_by_input It seems the form input tags
I'm trying to validate data in an imported csv file with Symfony2's validation component
I am trying to get my UniqueEmail validator working but it seems that my
The validation seems to fail for some reason. By the validation, I mean the
I have the following, which doesn't work, my validation seems that it's not triggered
I have a FluentValidation validator that I want to use to validate a booking.
ASP.NET MVC's Html.BeginForm() seems to work with jQuery validation plugin but the validation plugin
The validate and authenticate_form decorators don't seem to play nice together. This is my
hope you can help me on this one, I'm currently using this: jQuery plugin:validation
(Java Spring WebApp) I have: public class PersonValidator implements Validator { private PersonDAO d;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.