Development

#3864 (Chapter 2 - Form Validation of the Forms book contains an error)

You must first sign up to be able to contribute.

Ticket #3864 (closed documentation: fixed)

Opened 5 months ago

Last modified 5 months ago

Chapter 2 - Form Validation of the Forms book contains an error

Reported by: lunarmys Assigned to: fabien
Priority: minor Milestone:
Component: form Version: 1.1.0
Keywords: forms book setPostValidator Cc:
Qualification: Unreviewed

Description

The book currently says: Listing 2-16 - Combining several Post-Validators with a logical Validator

$this->validatorSchema->setPostValidator(array(

new sfValidatorSchemaCompare('start_date', '<=', 'end_date'), new sfValidatorSchemaCompare('password', '==', 'password_again'),

));

This doesn't work however (throws an error saying it expected an instance of sfValidatorBase, got an array).

One should use $this->validatorSchema->setPostValidator(new sfValidatorAnd(array(

new sfValidatorSchemaCompare('start_date', '<=', 'end_date'), new sfValidatorSchemaCompare('password', '==', 'password_again'),

)));

Change History

06/30/08 22:05:11 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [10027]) doc: fixed typo (closes #3864)