Esempio n. 1
0
 /**
  * Check if the fields has same value
  *
  * @param Rabbit_Field $to
  * @return boolean
  */
 public function compare_equals(Rabbit_Field $to)
 {
     $ci =& get_instance();
     $v1 = $this->field->getRawValue();
     $v2 = $to->getRawValue();
     if ($v1 != $v2) {
         $this->message = sprintf($ci->lang->line('rabbit_comparator_equals'), $this->field->getLabel(), $to->getLabel());
         return false;
     }
     return true;
 }
 /**
  * @see Rabbit_Field::__construct()
  *
  * @return void
  */
 public function __construct(Rabbit_Form $form, array $attributes = array())
 {
     parent::__construct($form, $attributes);
     $this->value = 0;
 }
 /**
  * Instantiate the validator
  *
  * @param Rabbit_Field $field
  * @param array $params
  */
 public function __construct(Rabbit_Field $field, array $params = array())
 {
     $this->field = $field;
     $this->field->addValidator($this);
     $this->setParams($params);
 }