Aologies. Pass it to the form object you are instantiating when you create
hte form in the action that will call the view to show the form:

$existing = UserModelClassPeer::getOldPassword($username);
$this->password_change_form = new ChangePasswordForm($defaults, $existing);


2009/2/25 Gareth McCumskey <[email protected]>

> In the forms class you are building in the constructor, allow it to accept
> a variable such as $existing:
>
> public function __construct($defaults, $existing)
>
> Then in the action that processes the submission of the form, call a model
> method to get the correct "old password" and pass it to the form constructor
> for use in the form validation.
>
> 2009/2/25 vadim <[email protected]>
>
>
>> Yeah, but I need to compare my "old_password" field value with
>> password retrieved from database, but not with another field value.
>> That is a problem for me, I don't know how to do that :(
>>
>> On 25 фев, 15:34, Andrei Dziahel <[email protected]> wrote:
>> > Hi.
>> >
>> > Yes.
>> http://www.symfony-project.org/book/forms/1_2/en/02-Form-Validation#c...
>> >
>> > On Wed, Feb 25, 2009 at 14:30, [email protected] <
>> >
>> > [email protected]> wrote:
>> >
>> > > Hi guys,
>> >
>> > > I have the following question. I have a form for password changing
>> > > with three fields - old_password, password and confirm_password. First
>> > > I need to check if old_password matches with my current password. What
>> > > is the easiest way to implement this? I guess, I should use
>> > > postValidators, but how?
>> >
>> > --
>> > With the best regards, Andy.
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to