addRule() 공개 메소드

Adds a validation rule for the current control.
public addRule ( $validator, $message = NULL, $arg = NULL ) : self
리턴 self
예제 #1
0
	/**
	 * 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;
	}
예제 #2
0
파일: BaseControl.php 프로젝트: nette/forms
 /**
  * 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;
 }
예제 #3
0
 /**
  * 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;
 }
예제 #4
0
 /**
  * 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;
 }