This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » Validation Dependancy
Re: Validation Dependancy [message #76457 is a reply to message #76408 ] Tue, 07 April 2009 17:16 Go to previous messageGo to previous message
design2host  is currently offline design2host
Messages: 35
Registered: February 2009
Location: United Kingdom
Member
Thanks. got it working via

public function configure()
{
	$this->validatorSchema->setPostValidator(
    	new sfValidatorCallback(array(
        	'callback' => array($this, 'myCallback')
    	))
 	);
}

public function myCallback($validator, $values)
{
	if ($values["reject"] == 1) 
    	{
    		if ($values["reject_reason"] == "")
	    	{
    			throw new sfValidatorError($validator, 'Please enter a reason');	
	    	}
	}
	return $values;
}


Chris Shennan
http://www.chrisshennan.com

Read Message
Read Message
Read Message
Read Message
Previous Topic:throw form errors from action/component
Next Topic:Extending sfSessionStorage, problem with $context
Goto Forum:

  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software