Yii Framework Forum: problem with compare and required. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

problem with compare and required. Rate Topic: -----

#1 User is offline   Esler Larius 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 08-August 10

Posted 27 March 2012 - 04:44 PM

I need to do a compare if they are different, but i dont know how to do that.
The another problem is, i use in the form reponsavle as the field, so in the model i have a public attribute called responsable.
But if i try to put them on required it dont work.

before_save(){
	$this->id_responsable = $this->responsable;
	$this->id_responsable2 = $this->responsable2;
}

rules(){
array('responsable', 'compare', 'compareAttribute'=>'responsable2'),
}

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users