Hello,
I want to use a custom error message while evaluating a database field.
So inside the public function rules()
i am trying this …
array(‘lpno’,‘unique’,‘caseSensitive’=>‘false’,‘message’=>‘Specified License plate -’.$this->lpno.’- number is already on file.’)
The value $this->lpno wont get appeneded to the message.
But
if i use it like this , it is able to pick up the value. why is this happening ?
array(‘lpno’,‘checkunique’),
public function checkunique()
{
if ($this->lpno == 'DEL-210')
$this->addError('lpno',Specified License plate -'.$this->lpno.'- number is already on file.');
}
thanks
Arvind