nettrinity
(Thanhvn Info)
1
Dear you,
Here is my custom validator to check if user email exist. But it appears to be a syntax error. I couldn’t figure it out. Please help!
public function newUser($attribute,$params)
{
if ( $this->exists('email=:email', array(':email'=>$this->email) )
return false;
else
return true;
}
tri
(tri - Tommy Riboe)
2
You have three left parentheses so you’ll also need three right parentheses
if ($this->exists('email=:email', array(':email'=>$this->email)))
/Tommy
mikl
(Mike)
4
Why not use the built in ‘unique’ validator in the first place?
array('email','unique'),