protected function getValidator($data = null)
    {
        if (!$this->validator) {
            if ($data) {
                // Validate without key
                if ($this->lastKey === '') {
                    $data = ['' => $data];
                }

                $this->options['data'] = $data;
            }

            $this->validator = $this->wei->validate($this->options);
        }

        return $this->validator;
    }
protected function getValidator($data = null)
    {
        if (!$this->validator) {
            if ($data) {
                // Validate without key
                if ($this->lastKey === '') {
                    $data = ['' => $data];
                }

                $this->options['data'] = $data;
            }

            $this->validator = $this->wei->validate($this->options);
        }

        return $this->validator;
    }
protected function getValidator ( $ data = null ) { if ( ! $ this -> validator ) { if ( $ data ) { // Validate without key if ( $ this -> lastKey === '' ) { $ data = [ '' => $ data ] ; } $ this -> options [ 'data' ] = $ data ; } $ this -> validator = $ this -> wei -> validate ( $ this -> options ) ; } return $ this -> validator ; }
Instance validate object

@param mixed $data
@return Validate
Instance validate object