hi all,
I m following askeet tutorial for my form validation.
I am using a custom validator "myLoginvalidator" as in askeet tutorial
and defined in /frontend/lib/myLoginvalidator.class.php.
now the problem is that the message i declared in custom validator
donot get displayed in form login.although the two arrows get
displayed.also the message of sfNumbervalidator donot get displayed
although the default message is displayed
here is code i m using
login.yml file:-----
methods:
post: [loginid,password]
names:
loginid:
required: true
required_msg: The name field cannot be left blank
validators: [loginidValidator,userValidator]
password:
required: true
required_msg: your password is required
loginidValidator:
class: sfNumberValidator
param:
min: 6
min_error: The value must be at least zero
userValidator:
class: myLoginValidator
param:
login_error: This account donot exit
fillin:
enabled: off
in myLoginValidator.class.php:---------
<?php
class myLoginValidator extends sfValidator
{
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->setParameter('login_error', 'Invalid input');
$this->getParameterHolder()->add($parameters);
return true;
}
public function execute(&$value, &$error)
{
$password_param = $this->getParameter('password');
$password = $this->getContext()->getRequest()->getParameter
($password_param);
if($values['password'])
{
$error = $this->getParameter('login_error');
return false;
}
}
}
so please any one of u please guide me or sort out my problem.i am new
to symfony and its my first hand experience.
waiting for someones reply.
thanks
vikash kumar
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---