Ok thank you Sid.  You were right.  Looking at a snippet at
http://snippets.symfony-project.org/snippets/tagged/login/order_by/date
I was able to format it correcty.  Is there any documentation that
tells you how these classes work.  The API documentation doesn't
appear to be very clear.

Here's a working example:

'user_name' => new sfValidatorAnd(array(
        new sfValidatorString(
            array(
                'min_length'    => 3,
                'max_length'    => 30,
            ),
            array(
                'min_length'    => 'User name is too short (%min_length
% characters minimum)',
                'max_length'    => 'User name is too long (%max_length
% characters maximum)',
            )),
        new sfValidatorRegex(
            array(
                'pattern'       => '#^[a-z0-9_-]+$#i',
            ),
            array(
                'invalid'       => 'Your user name can only contain
the characters a to Z, 0 to 9, _ and -',
            )),
    ), array(
            'required' => true,
    ), array(
            'required' => 'Please enter a user name',
    )
),


On Mar 9, 4:55 pm, Sid Bachtiar <sid.bacht...@gmail.com> wrote:
> Try to put "'required' => true" and required message on sfValidatorAnd
> and not on the validators inside it.

> --
> Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to