/** * Adds a validation rule. * @param mixed rule type * @param string message to display for invalid data * @param mixed optional rule arguments * @return FormControl provides a fluent interface */ public function addRule($operation, $message = NULL, $arg = NULL) { $this->rules->addRule($operation, $message, $arg); return $this; }
/** * Adds a validation rule. * @param mixed rule type * @param string message to display for invalid data * @param mixed optional rule arguments * @return self */ public function addRule($validator, $message = NULL, $arg = NULL) { $this->rules->addRule($validator, $message, $arg); return $this; }
/** * Makes control mandatory. * @param string error message * @return FormControl provides a fluent interface * @deprecated */ public final function setRequired($message = NULL) { $this->rules->addRule(Form::FILLED, $message); return $this; }
/** * Makes control mandatory. * @param string error message * @return FormControl provides a fluent interface * @deprecated */ public final function setRequired($message = NULL) { $this->rules->addRule(':Filled', $message); return $this; }
/** * Adds a validation rule. * * @param mixed rule type * @param string message to display for invalid data * @param mixed optional rule arguments * * @return BaseControl provides a fluent interface */ public function addRule($operation, $message = null, $arg = null) { $this->rules->addRule($operation, $message, $arg); return $this; }