sfValidatorFromDescription converts a string to a validator.
Method Summary
-
asPhp()
Returns a PHP representation for the validator.
-
array
convertInfixToRpn($tokens)
Converts a token array from an infix notation to a RPN.
-
getValidator()
-
array
parseArguments((string) $string, &$i, $i)
Parses validator arguments.
-
mixed
reduceTokens($tokens, (string) $method)
Reduces tokens to a single token and convert it with the given method.
-
array
tokenize((string) $string)
Tokenizes a validator string to a list of tokens in RPN.
-
__construct($string, $options = array(), $messages = array())
asString , clean , doClean , getDefaultMessages , getDefaultOptions , getMessage , getMessages , getOption , getOptions , getValidator , hasOption , setMessage , setMessages , setOption , setOptions , __construct
addMessage , addOption , addRequiredOption , asString , clean , configure , doClean , getCharset , getDefaultMessages , getDefaultOptions , getEmptyValue , getErrorCodes , getMessage , getMessages , getMessagesWithoutDefaults , getOption , getOptions , getOptionsWithoutDefaults , getRequiredOptions , hasOption , isEmpty , setCharset , setDefaultMessages , setDefaultOptions , setInvalidMessage , setMessage , setMessages , setOption , setOptions , setRequiredMessage , __construct
Method Details
-
Returns a PHP representation for the validator.
This PHP representation can be evaled to return the object validator. This is mainly useful to cache the result of the validator string parsing.
returns The PHP representation for the validator
-
(array) convertInfixToRpn ($tokens)
Browse code
| $tokens |
An array of tokens in infix notation
|
Converts a token array from an infix notation to a RPN.
returns An array of token in RPN
-
-
(array) parseArguments ((string) $string, &$i, $i)
Browse code
| $string |
The string to parse
|
| &$i |
|
| $i |
The indice to start the parsing
|
Parses validator arguments.
returns An array of parameters
-
(mixed) reduceTokens ($tokens, (string) $method)
Browse code
| $tokens |
An array of tokens
|
| $method |
The method name to execute on each token
|
Reduces tokens to a single token and convert it with the given method.
returns A single validator representation
-
(array) tokenize ((string) $string)
Browse code
| $string |
A validator string
|
Tokenizes a validator string to a list of tokens in RPN.
returns An array of tokens
-
__construct ($string, $options = array(), $messages = array())
Browse code
| $string |
|
| $options |
|
| $messages |
|
|