src/Form/Element/Element.php
public function addRule($rule, $method = null, $params = [], $message = null)
    {

        // construction des paramètres
        array_unshift($params, $rule, $method);

        call_user_func_array([$this->getValidator(), 'addRule'], $params);

        if (!is_null($message)) {
            if(is_array($message)){
                foreach($message as $rule => $message){
                    $this->getValidator()->addMessage($rule, $message);
                }
            }else{
                $this->getValidator()->addMessage($rule, $message);
            }
        }

        return $this;
    }
public function addRule($rule, $method = null, $params = [], $message = null)
    {

        // construction des paramètres
        array_unshift($params, $rule, $method);

        call_user_func_array([$this->getValidator(), 'addRule'], $params);

        if (!is_null($message)) {
            if(is_array($message)){
                foreach($message as $rule => $message){
                    $this->getValidator()->addMessage($rule, $message);
                }
            }else{
                $this->getValidator()->addMessage($rule, $message);
            }
        }

        return $this;
    }
public function addRule ( $ rule , $ method = null , $ params = [ ] , $ message = null ) { // construction des paramètres array_unshift ( $ params , $ rule , $ method ) ; call_user_func_array ( [ $ this -> getValidator ( ) , 'addRule' ] , $ params ) ; if ( ! is_null ( $ message ) ) { if ( is_array ( $ message ) ) { foreach ( $ message as $ rule => $ message ) { $ this -> getValidator ( ) -> addMessage ( $ rule , $ message ) ; } } else { $ this -> getValidator ( ) -> addMessage ( $ rule , $ message ) ; } } return $ this ; }
Ajoute un validator

@param $rule
@param null $method
@param array $params
@param null $message
@return $this
Ajoute un validator