public function createRuleValidator($rule, array $options = array())
    {
        // Starts with "not", such as notDigit, notEqual
        if (0 === stripos($rule, 'not')) {
            $options['negative'] = true;
            $rule = substr($rule, 3);
        }

        $object = 'is' . ucfirst($rule);
        $class = $this->wei->getClass($object);
        if (!$class || !class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Validator "%s" not found', $rule));
        }


        $options = $options + array('wei' => $this->wei) + (array)$this->wei->getConfig('is' . ucfirst($rule));

        return new $class($options);
    }
public function createRuleValidator($rule, array $options = array())
    {
        // Starts with "not", such as notDigit, notEqual
        if (0 === stripos($rule, 'not')) {
            $options['negative'] = true;
            $rule = substr($rule, 3);
        }

        $object = 'is' . ucfirst($rule);
        $class = $this->wei->getClass($object);
        if (!$class || !class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Validator "%s" not found', $rule));
        }


        $options = $options + array('wei' => $this->wei) + (array)$this->wei->getConfig('is' . ucfirst($rule));

        return new $class($options);
    }
public function createRuleValidator ( $ rule , array $ options = array ( ) ) { // Starts with "not", such as notDigit, notEqual if ( 0 === stripos ( $ rule , 'not' ) ) { $ options [ 'negative' ] = true ; $ rule = substr ( $ rule , 3 ) ; } $ object = 'is' . ucfirst ( $ rule ) ; $ class = $ this -> wei -> getClass ( $ object ) ; if ( ! $ class || ! class_exists ( $ class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Validator "%s" not found' , $ rule ) ) ; } $ options = $ options + array ( 'wei' => $ this -> wei ) + ( array ) $ this -> wei -> getConfig ( 'is' . ucfirst ( $ rule ) ) ; return new $ class ( $ options ) ; }
Create a rule validator instance by specified rule name

@param string $rule The name of rule validator
@param array $options The property options for rule validator
@return Validator\BaseValidator
@throws \InvalidArgumentException When validator not found
Create a rule validator instance by specified rule name