Thanks Gustavo, I think you mean this:

    $this->setValidator('email', new sfValidatorAnd(array(
new sfValidatorEmail(array('required' => true, 'trim' => true), array('required' => 'THIS FIELD IS REQUIRED')), new sfValidatorString(array('required' => true, 'max_length' => 80)),
       new sfValidatorDoctrineUnique(array(
         'model' => 'sfGuardUserProfile',
         'column' => 'email'
       ), array(
         'invalid' => 'An account with that email address already
exists. If you have forgotten your password, click "cancel", then "Reset
My Password."'))
     )));

but it doesn't work

On 08/24/2010 07:28 PM, Gustavo Adrian wrote:
Or course, that line could be on the BaseForm or even in the application configuration class so every form could use that default message. The same applies to the 'invalid' message.

On Tue, Aug 24, 2010 at 2:26 PM, Gustavo Adrian <comfortablynum...@gmail.com <mailto:comfortablynum...@gmail.com>> wrote:

    Maybe because first it's the sfValidatorEmail that throws the
    required error?

    Although, if you want to change the required field message to
    every validator, you could do this:

    sfValidatorBase::setDefaultMessage( 'required', 'My required
    message' );


    On Tue, Aug 24, 2010 at 1:53 PM, Javier Garcia
    <tirengar...@gmail.com <mailto:tirengar...@gmail.com>> wrote:

         I tried this:


           $this->setValidator('email', new sfValidatorAnd(array(
              new sfValidatorEmail(array('required' => true, 'trim' =>
        true)),
              new sfValidatorString(array('required' => true,
        'max_length' => 80), array('required' => 'THIS FIELD IS
        REQUIRED')),

              new sfValidatorDoctrineUnique(array(
                'model' => 'sfGuardUserProfile',
                'column' => 'email'
              ), array(
                'invalid' => 'An account with that email address already
        exists. If you have forgotten your password, click "cancel",
        then "Reset
        My Password."'))
            )));

        but it still shows "Required."



        On 08/24/2010 05:00 PM, Thor wrote:

            you have to pass it as an "required" field in an array,
            given as
            second parameter of the validator


            new sfvalidatorsomething(array(...),array('invalid'=>'invalid
            message','required'=>'required message'));

            On 24 Ago, 13:05, Javier Garcia<tirengar...@gmail.com
            <mailto:tirengar...@gmail.com>>  wrote:

                  Sorry, could you paste the entire validator? I dont
                understand..

                On 08/24/2010 08:47 AM, Michał Piotrowski wrote:





                    Eh, sorry,
                    1 array parameters
                    array('required' =>    true)
                    2 array messages
                    array('required' =>    'Pole wymagane.')

                        'required' =>    true,
                               'invalid' =>    'An account with that
                        email address already
                        exists. If you have forgotten your password,
                        click "cancel", then
                        "Reset My Password."'),
                          array('required' =>    'Pole wymagane.')
                        )
                           )));
                        Should do the trick
                        Regards,
                        M

                            but i don't know where should i add
                            something like this: 'required' =>    'You
                            must write your e-mail').
                            Any idea?
                            --
                            Javi
                            Ubuntu 8.04
                            --
                            If you want to report a vulnerability
                            issue on symfony, please send it to
                            security at symfony-project.com
                            <http://symfony-project.com>
                            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
                            <mailto:symfony-users@googlegroups.com>
                            To unsubscribe from this group, send email to
                            symfony-users+unsubscr...@googlegroups.com
                            
<mailto:symfony-users%2bunsubscr...@googlegroups.com>
                            For more options, visit this group at
                            http://groups.google.com/group/symfony-users?hl=en

                --
                Javi

                Ubuntu 8.04



-- Javi

        Ubuntu 8.04

-- If you want to report a vulnerability issue on symfony, please
        send it to security at symfony-project.com
        <http://symfony-project.com>

        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
        <mailto:symfony-users@googlegroups.com>
        To unsubscribe from this group, send email to
        symfony-users+unsubscr...@googlegroups.com
        <mailto:symfony-users%2bunsubscr...@googlegroups.com>
        For more options, visit this group at
        http://groups.google.com/group/symfony-users?hl=en



--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

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


--
Javi

Ubuntu 8.04

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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